diff --git a/Cargo.lock b/Cargo.lock index 67eb577f1..3a06e2900 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1242,9 +1242,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" dependencies = [ "smallvec", ] diff --git a/light-clients/ics08-wasm/src/instantiate.rs b/light-clients/ics08-wasm/src/instantiate.rs index 91c9a6d17..e76286a6a 100644 --- a/light-clients/ics08-wasm/src/instantiate.rs +++ b/light-clients/ics08-wasm/src/instantiate.rs @@ -16,3 +16,5 @@ pub struct InstantiateMessage { #[cfg_attr(feature = "cosmwasm", serde(with = "Base64", default))] pub checksum: Bytes, } + + diff --git a/light-clients/ics08-wasm/src/lib.rs b/light-clients/ics08-wasm/src/lib.rs index 9cc2b5a1d..284bb1e7f 100644 --- a/light-clients/ics08-wasm/src/lib.rs +++ b/light-clients/ics08-wasm/src/lib.rs @@ -25,6 +25,7 @@ pub mod client_message; pub mod client_state; pub mod consensus_state; pub mod instantiate; +pub mod migrate; pub mod msg; pub type Bytes = Vec; diff --git a/light-clients/ics08-wasm/src/migrate.rs b/light-clients/ics08-wasm/src/migrate.rs new file mode 100644 index 000000000..f2f2aa652 --- /dev/null +++ b/light-clients/ics08-wasm/src/migrate.rs @@ -0,0 +1,9 @@ +use crate::{msg::Base64, Bytes}; +#[cfg(feature = "cosmwasm")] +use cosmwasm_schema::cw_serde; + + +#[cfg_attr(feature = "cosmwasm", cw_serde)] +#[cfg_attr(not(feature = "cosmwasm"), derive(Clone, Debug, PartialEq))] +#[derive(Eq)] +pub struct MigrateMsg {} \ No newline at end of file diff --git a/light-clients/ics10-grandpa-cw/src/contract.rs b/light-clients/ics10-grandpa-cw/src/contract.rs index 8503bc5aa..c4128ade7 100644 --- a/light-clients/ics10-grandpa-cw/src/contract.rs +++ b/light-clients/ics10-grandpa-cw/src/contract.rs @@ -44,7 +44,7 @@ use ibc::core::{ ics24_host::identifier::ClientId, }; use ibc_proto::google::protobuf::Any; -use ics08_wasm::{instantiate::InstantiateMessage, SUBJECT_PREFIX, SUBSTITUTE_PREFIX}; +use ics08_wasm::{instantiate::InstantiateMessage, migrate::MigrateMsg, SUBJECT_PREFIX, SUBSTITUTE_PREFIX}; use ics10_grandpa::{ client_def::GrandpaClient, client_message::{ClientMessage, RelayChainHeader}, @@ -64,6 +64,8 @@ const CONTRACT_NAME: &str = "crates.io:ics10-grandpa-cw"; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); */ + + pub const CHANNELS_CONNECTION: Map> = Map::new("channels_connection"); pub const CLIENT_UPDATE_TIME: Map<(Bytes, Bytes), u64> = Map::new("client_update_time"); pub const CLIENT_UPDATE_HEIGHT: Map<(Bytes, Bytes), Bytes> = Map::new("client_update_height"); @@ -117,6 +119,13 @@ impl grandpa_light_client_primitives::HostFunctions for HostFunctions { } } + +#[entry_point] +pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { + // No state migrations performed, just returned a Response + Ok(Response::default()) +} + fn process_instantiate_msg( msg: InstantiateMessage, ctx: &mut Context,