Skip to content

Commit

Permalink
add channel ordering to register ICA
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Aug 7, 2024
1 parent 4749620 commit ea3991b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ incremental = false
overflow-checks = true

[workspace.dependencies]
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/remove-stargate" }
neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/unordered-ica" }
prost = "0.12.4"
prost-types = "0.12.4"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
Expand Down
7 changes: 5 additions & 2 deletions contracts/neutron_interchain_txs/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::integration_tests_mock_handlers::{
use crate::msg::{
AcknowledgementResultsResponse, ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg,
};
use neutron_sdk::bindings::msg::{IbcFee, NeutronMsg};
use neutron_sdk::bindings::msg::{ChannelOrdering, IbcFee, NeutronMsg};
use neutron_sdk::bindings::query::{NeutronQuery, QueryInterchainAccountAddressResponse};
use neutron_sdk::bindings::types::ProtobufAny;
use neutron_sdk::interchain_txs::helpers::{decode_message_response, get_port_id};
Expand Down Expand Up @@ -108,7 +108,8 @@ pub fn execute(
ExecuteMsg::Register {
connection_id,
interchain_account_id,
} => execute_register_ica(deps, env, connection_id, interchain_account_id),
ordering,
} => execute_register_ica(deps, env, connection_id, interchain_account_id, ordering),
ExecuteMsg::Delegate {
validator,
interchain_account_id,
Expand Down Expand Up @@ -307,12 +308,14 @@ fn execute_register_ica(
env: Env,
connection_id: String,
interchain_account_id: String,
ordering: Option<ChannelOrdering>,
) -> StdResult<Response<NeutronMsg>> {
let register_fee = REGISTER_FEE.load(deps.storage)?;
let register = NeutronMsg::register_interchain_account(
connection_id,
interchain_account_id.clone(),
Option::from(register_fee),
ordering,
);
let key = get_port_id(env.contract.address.as_str(), &interchain_account_id);
INTERCHAIN_ACCOUNTS.save(deps.storage, key, &None)?;
Expand Down
6 changes: 4 additions & 2 deletions contracts/neutron_interchain_txs/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::storage::{AcknowledgementResult, IntegrationTestsSudoFailureMock};
use cosmwasm_std::Uint128;
use neutron_sdk::bindings::msg::ChannelOrdering;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -38,6 +39,7 @@ pub enum ExecuteMsg {
Register {
connection_id: String,
interchain_account_id: String,
ordering: Option<ChannelOrdering>,
},
SetFees {
denom: String,
Expand Down Expand Up @@ -76,11 +78,11 @@ pub enum ExecuteMsg {
state: IntegrationTestsSudoFailureMock,
},
/// Used only in integration tests framework to simulate failures.
/// After executing this message, any sudo call to the contract will result in an submessage
/// After executing this message, any sudo call to the contract will result in a submessage
/// processing error.
IntegrationTestsSetSudoSubmsgFailureMock {},
/// Used only in integration tests framework to simulate failures.
/// After executing this message, any sudo call to the contract will result in an submessage
/// After executing this message, any sudo call to the contract will result in a submessage
/// reply processing error.
IntegrationTestsSetSudoSubmsgReplyFailureMock {},
/// Used only in integration tests framework to simulate failures.
Expand Down

0 comments on commit ea3991b

Please sign in to comment.