From fb603abccdb8892b9855ba2d6518d1df93d76315 Mon Sep 17 00:00:00 2001 From: aeryz Date: Thu, 29 Aug 2024 12:44:15 +0300 Subject: [PATCH] feat(devnet): add ics08-movement to union devnet Signed-off-by: aeryz --- Cargo.toml | 2 +- dictionary.txt | 9 +++++++++ flake.nix | 1 + lib/unionlabs/src/aptos/signature.rs | 2 +- lib/unionlabs/src/aptos/state_proof.rs | 2 +- .../ics08-movement/ics08-movement.nix | 19 +++++++++++++++++++ move/move-ibc/sources/IBC.move | 7 ++----- move/move-ibc/sources/ProtoUtils.move | 2 +- move/move-ibc/tests/channel_test.move | 10 +++++----- move/move-ibc/tests/connection_test.move | 1 - networks/devnet.nix | 1 + 11 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 light-clients/movement/ics08-movement/ics08-movement.nix diff --git a/Cargo.toml b/Cargo.toml index 44bc1e4840..3a082b8adc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ opt-level = 3 strip = true [workspace.dependencies] -aptos-verifier = { path = "lib/aptos-verifier", default-faetures = false } +aptos-verifier = { path = "lib/aptos-verifier", default-features = false } arbitrum-verifier = { path = "lib/arbitrum-verifier", default-features = false } beacon-api = { path = "lib/beacon-api", default-features = false } block-message = { path = "lib/block-message", default-features = false } diff --git a/dictionary.txt b/dictionary.txt index cac0b87f2a..1792e2af24 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -244,6 +244,7 @@ appchain appchains appmodule appparams +aptos arbitrum arbtest arethetypeswrong @@ -303,6 +304,7 @@ bitfield bitfield's bitfields bitlist +bitmask bitsize bitslice bitsong @@ -376,6 +378,7 @@ commitmenttypes committes compat composability +compr concat configurator confix @@ -473,6 +476,7 @@ dymension echarts eitherway elems +elfutils elgafar elit endianness @@ -1068,6 +1072,7 @@ stridevalcons stridevalconspub stridevaloper stridevaloperpub +strlen struct structs strxor @@ -1076,6 +1081,7 @@ subaccount subdenom subdenoms subdetail +subdir submessage submessages submsg @@ -1175,6 +1181,7 @@ umee unbond unbonded unbonding +uncompr uncons undelegate undelegations @@ -1222,8 +1229,10 @@ upgradability upgradeclient upgradekeeper upgradetypes +upsert urql ursi +usecs usertransfers usizes ustars diff --git a/flake.nix b/flake.nix index e1e07279d0..216fd13efa 100644 --- a/flake.nix +++ b/flake.nix @@ -250,6 +250,7 @@ ./light-clients/linea-light-client/linea-light-client.nix ./light-clients/berachain-light-client/berachain-light-client.nix ./light-clients/evm-in-cosmos-light-client/evm-in-cosmos-light-client.nix + ./light-clients/movement/ics08-movement/ics08-movement.nix ./lib/cometbls-groth16-verifier/default.nix ./lib/linea-verifier/default.nix ./lib/linea-zktrie/default.nix diff --git a/lib/unionlabs/src/aptos/signature.rs b/lib/unionlabs/src/aptos/signature.rs index fc4715bfcf..b5334e485b 100644 --- a/lib/unionlabs/src/aptos/signature.rs +++ b/lib/unionlabs/src/aptos/signature.rs @@ -10,7 +10,7 @@ use super::bit_vec::BitVec; from ) )] -/// Either (1) a BLS signature share from an individual signer, (2) a BLS multisignature or (3) a +/// Either (1) a BLS signature share from an individual signer, (2) a BLS multi-signature or (3) a /// BLS aggregate signature pub struct Signature { pub sig: Vec, diff --git a/lib/unionlabs/src/aptos/state_proof.rs b/lib/unionlabs/src/aptos/state_proof.rs index 1a5d151e10..4e240152cb 100644 --- a/lib/unionlabs/src/aptos/state_proof.rs +++ b/lib/unionlabs/src/aptos/state_proof.rs @@ -11,7 +11,7 @@ use super::{ }; use crate::errors::{required, MissingField}; -/// A convenience type for the collection of sub-proofs that consistitute a +/// A convenience type for the collection of sub-proofs that constitute a /// response to a `get_state_proof` request. /// /// From a `StateProof` response, a client should be able to ratchet their diff --git a/light-clients/movement/ics08-movement/ics08-movement.nix b/light-clients/movement/ics08-movement/ics08-movement.nix new file mode 100644 index 0000000000..47c9ab96ba --- /dev/null +++ b/light-clients/movement/ics08-movement/ics08-movement.nix @@ -0,0 +1,19 @@ +{ ... }: { + perSystem = { crane, lib, ensure-wasm-client-type, ... }: + let + workspace = (crane.buildWasmContract { + crateDirFromRoot = "light-clients/movement/ics08-movement"; + checks = [ + (file_path: '' + ${ensure-wasm-client-type { + inherit file_path; + type = "Movement"; + }} + '') + ]; + }); + in + { + inherit (workspace) packages checks; + }; +} diff --git a/move/move-ibc/sources/IBC.move b/move/move-ibc/sources/IBC.move index 620f3474fa..8c120dacba 100644 --- a/move/move-ibc/sources/IBC.move +++ b/move/move-ibc/sources/IBC.move @@ -700,7 +700,7 @@ module IBC::Core { proof_client: Any, _proof_consensus: vector, proof_height: height::Height, - _consenseus_height: height::Height, + _consensus_height: height::Height, ):String acquires IBCStore { // Generate a new connection identifier let connection_id = generate_connection_identifier(); @@ -789,7 +789,7 @@ module IBC::Core { _proof_consensus: vector, counterparty_connection_id: String, proof_height: height::Height, - _consenseus_height: height::Height + _consensus_height: height::Height ) acquires IBCStore { let store = borrow_global_mut(get_vault_addr()); @@ -1241,9 +1241,6 @@ module IBC::Core { channel::set_state(&mut channel, CHAN_STATE_OPEN); update_channel_commitment(port_id, channel_id); - // TODO(aeryz): this funciton is gonna be called by the ibc app - // IBCModule::on_chan_open_confirm(port_id, channel_id); - smart_table::upsert(&mut borrow_global_mut(get_vault_addr()).channels, channel_port, channel); event::emit( diff --git a/move/move-ibc/sources/ProtoUtils.move b/move/move-ibc/sources/ProtoUtils.move index 480c2f408c..19696f7b70 100644 --- a/move/move-ibc/sources/ProtoUtils.move +++ b/move/move-ibc/sources/ProtoUtils.move @@ -264,7 +264,7 @@ module IBC::proto_utils { let exp = vector [ string::utf8(b"h"), string::utf8(b"hello world"), - string::utf8(b"hello worldas enednsedn eansd"), + string::utf8(b"hello world hello again"), ]; let i = 0; diff --git a/move/move-ibc/tests/channel_test.move b/move/move-ibc/tests/channel_test.move index 1022b32375..28a1334919 100644 --- a/move/move-ibc/tests/channel_test.move +++ b/move/move-ibc/tests/channel_test.move @@ -148,17 +148,17 @@ module IBC::ChannelTest { assert!(is_lowercase, 7001); // Test case where the string is not lowercase - let mixedcase_string = string::utf8(b"MixedCase"); - let is_not_lowercase = Core::is_lowercase(&mixedcase_string); + let mixed_case_string = string::utf8(b"Mixed_Case"); + let is_not_lowercase = Core::is_lowercase(&mixed_case_string); assert!(!is_not_lowercase, 7002); // Test case where the string is not lowercase - let mixedcase_string = string::utf8(b"ItsWrong"); - let is_not_lowercase = Core::is_lowercase(&mixedcase_string); + let mixed_case_string = string::utf8(b"ItsWrong"); + let is_not_lowercase = Core::is_lowercase(&mixed_case_string); assert!(!is_not_lowercase, 7002); - let lowercase_string = string::utf8(b"thisshouldbecorrecttoo"); + let lowercase_string = string::utf8(b"this_should_be_correct_too"); let is_lowercase = Core::is_lowercase(&lowercase_string); assert!(is_lowercase, 7001); diff --git a/move/move-ibc/tests/connection_test.move b/move/move-ibc/tests/connection_test.move index 54f93d4be4..1ee17d7cbb 100644 --- a/move/move-ibc/tests/connection_test.move +++ b/move/move-ibc/tests/connection_test.move @@ -586,7 +586,6 @@ module IBC::ConnectionTest { // let client_id = string::utf8(b"client-0"); // let version = Core::default_ibc_version(); // let delay_period: u64 = 0; - // let counterparty_prefix = Core::new_merkleprefix(vector::empty()); // let counterparty = Core::new_connection_counterparty( // string::utf8(b"counterparty-client"), // string::utf8(b"connection-0"), diff --git a/networks/devnet.nix b/networks/devnet.nix index e61f64abde..1d12f2902f 100644 --- a/networks/devnet.nix +++ b/networks/devnet.nix @@ -62,6 +62,7 @@ # self'.packages.scroll-light-client self'.packages.arbitrum-light-client # self'.packages.berachain-light-client + self'.packages.ics08-movement ]; cosmwasmContracts = [ {