Skip to content

Commit

Permalink
chore: bump deps (#11)
Browse files Browse the repository at this point in the history
* chore: bump deps

* pull factory changes from core repo
  • Loading branch information
epanchee authored Feb 16, 2024
1 parent c981892 commit 3c5ae0b
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 122 deletions.
245 changes: 127 additions & 118 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions contracts/factory/examples/factory_schema.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use astroport::factory::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};
use astroport::factory::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
migrate: MigrateMsg,
}
}
5 changes: 5 additions & 0 deletions contracts/factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ pub fn execute_create_pair(
.load(deps.storage, pair_type.to_string())
.map_err(|_| ContractError::PairConfigNotFound {})?;

let config = CONFIG.load(deps.storage)?;
if pair_config.permissioned && info.sender != config.owner {
return Err(ContractError::Unauthorized {});
}

// Check if pair config is disabled
if pair_config.is_disabled {
return Err(ContractError::PairConfigDisabled {});
Expand Down
1 change: 1 addition & 0 deletions contracts/factory/tests/factory_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ impl FactoryHelper {
maker_fee_bps: 5000,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
token_code_id: 0,
fee_address: None,
Expand Down
1 change: 1 addition & 0 deletions contracts/factory/tests/factory_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fn proper_initialization() {
maker_fee_bps: 10,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}];

let msg = InstantiateMsg {
Expand Down
12 changes: 12 additions & 0 deletions contracts/factory/tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn test_init() {
maker_fee_bps: 5000,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
},
// Two pair configs with equal types are not allowed
PairConfig {
Expand All @@ -49,6 +50,7 @@ fn test_init() {
maker_fee_bps: 5000,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
},
],
token_code_id: 0,
Expand All @@ -74,6 +76,7 @@ fn test_init() {
maker_fee_bps: 5000,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
token_code_id: 0,
fee_address: None,
Expand All @@ -94,6 +97,7 @@ fn test_init() {
maker_fee_bps: 5000,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
token_code_id: 0,
fee_address: None,
Expand Down Expand Up @@ -123,6 +127,7 @@ fn update_config() {
maker_fee_bps: 166,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}];

let msg = InstantiateMsg {
Expand Down Expand Up @@ -271,6 +276,7 @@ fn update_pair_config() {
maker_fee_bps: 10,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}];

let msg = InstantiateMsg {
Expand Down Expand Up @@ -302,6 +308,7 @@ fn update_pair_config() {
maker_fee_bps: 2,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
};

// Unauthorized err
Expand All @@ -325,6 +332,7 @@ fn update_pair_config() {
maker_fee_bps: 10_001,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
},
};

Expand Down Expand Up @@ -352,6 +360,7 @@ fn update_pair_config() {
maker_fee_bps: 20,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
};

let info = mock_info(owner, &[]);
Expand Down Expand Up @@ -381,6 +390,7 @@ fn update_pair_config() {
maker_fee_bps: 5000,
is_disabled: true,
is_generator_disabled: false,
permissioned: false,
},
},
)
Expand Down Expand Up @@ -417,6 +427,7 @@ fn create_pair() {
maker_fee_bps: 10,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
};

let factory_init_msg = InstantiateMsg {
Expand Down Expand Up @@ -542,6 +553,7 @@ fn register() {
maker_fee_bps: 10,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
token_code_id: 123u64,
fee_address: Some("maker".to_owned()),
Expand Down
10 changes: 10 additions & 0 deletions contracts/pair_concentrated/examples/pair_concentrated_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use astroport::factory::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
}
}
1 change: 1 addition & 0 deletions contracts/pair_concentrated/tests/common/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ impl Helper {
pair_type: pair_type.clone(),
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
token_code_id,
generator_address: None,
Expand Down
1 change: 1 addition & 0 deletions e2e_tests/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ impl<'a> TestAppWrapper<'a> {
maker_fee_bps: 0,
is_disabled: false,
is_generator_disabled: false,
permissioned: false,
}],
fee_address: Some(FAKE_MAKER.to_string()),
generator_address: None,
Expand Down
3 changes: 1 addition & 2 deletions scripts/check_artifacts_size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
set -e
set -o pipefail

# terra: https://github.com/terra-money/wasmd/blob/2308975f45eac299bdf246737674482eaa51051c/x/wasm/types/validation.go#L12
# injective: https://github.com/InjectiveLabs/wasmd/blob/e087f275712b5f0a798791495dee0e453d67cad3/x/wasm/types/validation.go#L19
# osmosis v22.0.5: https://github.com/osmosis-labs/wasmd/blob/aba521a80563ceb88d27d14e5d7527735f4aae5d/x/wasm/types/validation.go#L22
maximum_size=800

for artifact in artifacts/*.wasm; do
Expand Down

0 comments on commit 3c5ae0b

Please sign in to comment.