From 9d40863f76a26828e9781cca672ba8445bf6c4ee Mon Sep 17 00:00:00 2001 From: Kien Date: Tue, 21 May 2024 22:38:05 +0700 Subject: [PATCH] feat(grandpa): expose migrate entry point (#499) * feat(grandpa): expose migrate entry point * chore: remote ununsed instantiate interface file --- Cargo.lock | 4 ++-- light-clients/ics10-grandpa-cw/src/contract.rs | 10 ++++++++-- light-clients/ics10-grandpa-cw/src/msg.rs | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3209a3d0..116e5a24c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1160,9 +1160,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/ics10-grandpa-cw/src/contract.rs b/light-clients/ics10-grandpa-cw/src/contract.rs index bb1c49cad..685ff14dd 100644 --- a/light-clients/ics10-grandpa-cw/src/contract.rs +++ b/light-clients/ics10-grandpa-cw/src/contract.rs @@ -20,8 +20,8 @@ use crate::{ msg::{ CheckForMisbehaviourMsg, CheckSubstituteAndUpdateStateMsg, ContractResult, ExecuteMsg, ExportMetadataMsg, InstantiateMsg, QueryMsg, QueryResponse, StatusMsg, UpdateStateMsg, - UpdateStateOnMisbehaviourMsg, VerifyClientMessage, VerifyMembershipMsg, - VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg, + UpdateStateOnMisbehaviourMsg, VerifyClientMessage, VerifyMembershipMsg, MigrateMsg, + VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg }, state::{get_client_state, get_consensus_state}, Bytes, @@ -113,6 +113,12 @@ 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()) +} + #[cfg_attr(not(feature = "library"), entry_point)] pub fn instantiate( _deps: DepsMut, diff --git a/light-clients/ics10-grandpa-cw/src/msg.rs b/light-clients/ics10-grandpa-cw/src/msg.rs index 0aea7b7eb..5a02f9df9 100644 --- a/light-clients/ics10-grandpa-cw/src/msg.rs +++ b/light-clients/ics10-grandpa-cw/src/msg.rs @@ -109,6 +109,9 @@ pub struct ClientStateCallResponse { pub result: ContractResult, } +#[cw_serde] +pub struct MigrateMsg {} + #[cw_serde] pub struct InstantiateMsg {}