Skip to content

Commit

Permalink
fix: handshake now saves the address
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jun 17, 2023
1 parent 15a4865 commit b27ffcf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/ibc_module/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cosmwasm_std::{

use super::types::{keys::HOST_PORT_ID, metadata::IcaMetadata};
use crate::{
state::{ChannelState, ContractChannelState, CHANNEL_STATE},
state::{ChannelState, ContractChannelState, CHANNEL_STATE, STATE},
ContractError,
};

Expand Down Expand Up @@ -112,7 +112,14 @@ fn ibc_on_channel_open_acknowledgement(
if metadata.address.is_empty() {
return Err(ContractError::InvalidAddress {});
}
// TODO: save the address to the contract state
// save the address to the contract state
STATE.update(
deps.storage,
|mut contract_state| -> Result<_, ContractError> {
contract_state.ica_address = Some(metadata.address);
Ok(contract_state)
},
)?;

// Save the channel state
CHANNEL_STATE.save(
Expand Down

0 comments on commit b27ffcf

Please sign in to comment.