diff --git a/ampd/src/handlers/evm_verify_msg.rs b/ampd/src/handlers/evm_verify_msg.rs index 7380a49ca..dcb7e331d 100644 --- a/ampd/src/handlers/evm_verify_msg.rs +++ b/ampd/src/handlers/evm_verify_msg.rs @@ -226,15 +226,13 @@ mod tests { use std::str::FromStr; use axelar_wasm_std::msg_id::HexTxHashAndEventIndex; - use base64::engine::general_purpose::STANDARD; - use base64::Engine; use cosmwasm_std; use error_stack::{Report, Result}; + use ethers_core::types::{H160, H256}; use ethers_providers::ProviderError; use events::Error::{DeserializationFailed, EventTypeMismatch}; use events::Event; use router_api::ChainName; - use tendermint::abci; use tokio::sync::watch; use tokio::test as async_test; use voting_verifier::events::{PollMetadata, PollStarted, TxEventConfirmation}; @@ -243,14 +241,15 @@ mod tests { use crate::event_processor::EventHandler; use crate::evm::finalizer::Finalization; use crate::evm::json_rpc::MockEthereumClient; - use crate::types::{EVMAddress, Hash, TMAddress}; + use crate::handlers::tests::{into_structured_event, participants}; + use crate::types::TMAddress; use crate::PREFIX; fn poll_started_event(participants: Vec, expires_at: u64) -> PollStarted { let msg_ids = [ - HexTxHashAndEventIndex::new(Hash::random(), 0u64), - HexTxHashAndEventIndex::new(Hash::random(), 1u64), - HexTxHashAndEventIndex::new(Hash::random(), 10u64), + HexTxHashAndEventIndex::new(H256::repeat_byte(1), 0u64), + HexTxHashAndEventIndex::new(H256::repeat_byte(2), 1u64), + HexTxHashAndEventIndex::new(H256::repeat_byte(3), 10u64), ]; PollStarted::Messages { metadata: PollMetadata { @@ -272,28 +271,28 @@ mod tests { tx_id: msg_ids[0].tx_hash_as_hex(), event_index: u32::try_from(msg_ids[0].event_index).unwrap(), message_id: msg_ids[0].to_string().parse().unwrap(), - source_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), + source_address: format!("0x{:x}", H160::repeat_byte(1)).parse().unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + destination_address: format!("0x{:x}", H160::repeat_byte(2)).parse().unwrap(), + payload_hash: H256::repeat_byte(4).to_fixed_bytes(), }, TxEventConfirmation { tx_id: msg_ids[1].tx_hash_as_hex(), event_index: u32::try_from(msg_ids[1].event_index).unwrap(), message_id: msg_ids[1].to_string().parse().unwrap(), - source_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), + source_address: format!("0x{:x}", H160::repeat_byte(3)).parse().unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + destination_address: format!("0x{:x}", H160::repeat_byte(4)).parse().unwrap(), + payload_hash: H256::repeat_byte(5).to_fixed_bytes(), }, TxEventConfirmation { tx_id: msg_ids[2].tx_hash_as_hex(), event_index: u32::try_from(msg_ids[2].event_index).unwrap(), message_id: msg_ids[2].to_string().parse().unwrap(), - source_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), + source_address: format!("0x{:x}", H160::repeat_byte(5)).parse().unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + destination_address: format!("0x{:x}", H160::repeat_byte(6)).parse().unwrap(), + payload_hash: H256::repeat_byte(6).to_fixed_bytes(), }, ], } @@ -302,7 +301,7 @@ mod tests { #[test] fn should_not_deserialize_incorrect_event() { // incorrect event type - let mut event: Event = to_event( + let mut event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); @@ -322,7 +321,7 @@ mod tests { )); // invalid field - let mut event: Event = to_event( + let mut event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); @@ -344,13 +343,14 @@ mod tests { } #[test] - fn should_deserialize_correct_event() { - let event: Event = to_event( + fn evm_verify_msg_should_deserialize_correct_event() { + let event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); - let event: Result = event.try_into(); - assert!(event.is_ok()); + let event: PollStartedEvent = event.try_into().unwrap(); + + goldie::assert_debug!(event); } #[async_test] @@ -366,7 +366,7 @@ mod tests { let voting_verifier_contract = TMAddress::random(PREFIX); let verifier = TMAddress::random(PREFIX); let expiration = 100u64; - let event: Event = to_event( + let event: Event = into_structured_event( poll_started_event(participants(5, Some(verifier.clone())), expiration), &voting_verifier_contract, ); @@ -390,30 +390,4 @@ mod tests { // poll is expired, should not hit rpc error now assert_eq!(handler.handle(&event).await.unwrap(), vec![]); } - - fn to_event(event: impl Into, contract_address: &TMAddress) -> Event { - let mut event: cosmwasm_std::Event = event.into(); - - event.ty = format!("wasm-{}", event.ty); - event = event.add_attribute("_contract_address", contract_address.to_string()); - - abci::Event::new( - event.ty, - event - .attributes - .into_iter() - .map(|cosmwasm_std::Attribute { key, value }| { - (STANDARD.encode(key), STANDARD.encode(value)) - }), - ) - .try_into() - .unwrap() - } - - fn participants(n: u8, verifier: Option) -> Vec { - (0..n) - .map(|_| TMAddress::random(PREFIX)) - .chain(verifier) - .collect() - } } diff --git a/ampd/src/handlers/evm_verify_verifier_set.rs b/ampd/src/handlers/evm_verify_verifier_set.rs index 85f1ed2a6..3f9e69b3e 100644 --- a/ampd/src/handlers/evm_verify_verifier_set.rs +++ b/ampd/src/handlers/evm_verify_verifier_set.rs @@ -200,15 +200,13 @@ mod tests { use std::str::FromStr; use axelar_wasm_std::msg_id::HexTxHashAndEventIndex; - use base64::engine::general_purpose::STANDARD; - use base64::Engine; - use error_stack::{Report, Result}; + use error_stack::Report; + use ethers_core::types::H256; use ethers_providers::ProviderError; use events::Event; use multisig::key::KeyType; use multisig::test::common::{build_verifier_set, ecdsa_test_data}; use router_api::ChainName; - use tendermint::abci; use tokio::sync::watch; use tokio::test as async_test; use voting_verifier::events::{PollMetadata, PollStarted, VerifierSetConfirmation}; @@ -217,18 +215,19 @@ mod tests { use crate::evm::finalizer::Finalization; use crate::evm::json_rpc::MockEthereumClient; use crate::handlers::evm_verify_verifier_set::PollStartedEvent; - use crate::types::{Hash, TMAddress}; + use crate::handlers::tests::{into_structured_event, participants}; + use crate::types::TMAddress; use crate::PREFIX; #[test] - fn should_deserialize_correct_event() { - let event: Event = to_event( + fn evm_verify_verifier_set_should_deserialize_correct_event() { + let event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); - let event: Result = event.try_into(); + let event: PollStartedEvent = event.try_into().unwrap(); - assert!(event.is_ok()); + goldie::assert_debug!(event); } #[async_test] @@ -244,7 +243,7 @@ mod tests { let voting_verifier = TMAddress::random(PREFIX); let verifier = TMAddress::random(PREFIX); let expiration = 100u64; - let event: Event = to_event( + let event: Event = into_structured_event( poll_started_event(participants(5, Some(verifier.clone())), expiration), &voting_verifier, ); @@ -270,7 +269,7 @@ mod tests { } fn poll_started_event(participants: Vec, expires_at: u64) -> PollStarted { - let msg_id = HexTxHashAndEventIndex::new(Hash::random(), 100u64); + let msg_id = HexTxHashAndEventIndex::new(H256::repeat_byte(1), 100u64); PollStarted::VerifierSet { #[allow(deprecated)] // TODO: The below event uses the deprecated tx_id and event_index fields. Remove this attribute when those fields are removed verifier_set: VerifierSetConfirmation { @@ -294,30 +293,4 @@ mod tests { }, } } - - fn to_event(event: impl Into, contract_address: &TMAddress) -> Event { - let mut event: cosmwasm_std::Event = event.into(); - - event.ty = format!("wasm-{}", event.ty); - event = event.add_attribute("_contract_address", contract_address.to_string()); - - abci::Event::new( - event.ty, - event - .attributes - .into_iter() - .map(|cosmwasm_std::Attribute { key, value }| { - (STANDARD.encode(key), STANDARD.encode(value)) - }), - ) - .try_into() - .unwrap() - } - - fn participants(n: u8, verifier: Option) -> Vec { - (0..n) - .map(|_| TMAddress::random(PREFIX)) - .chain(verifier) - .collect() - } } diff --git a/ampd/src/handlers/mod.rs b/ampd/src/handlers/mod.rs index 1f8868164..36234c442 100644 --- a/ampd/src/handlers/mod.rs +++ b/ampd/src/handlers/mod.rs @@ -16,6 +16,7 @@ mod tests { use base64::engine::general_purpose::STANDARD; use base64::Engine; + use cosmrs::AccountId; use events::Event; use tendermint::abci; @@ -47,7 +48,11 @@ mod tests { pub fn participants(n: u8, verifier: Option) -> Vec { (0..n) - .map(|_| TMAddress::random(PREFIX)) + .map(|i| { + AccountId::new(PREFIX, &[i; AccountId::MAX_LENGTH]) + .unwrap() + .into() + }) .chain(verifier) .collect() } diff --git a/ampd/src/handlers/mvx_verify_msg.rs b/ampd/src/handlers/mvx_verify_msg.rs index afed50e88..9eb212922 100644 --- a/ampd/src/handlers/mvx_verify_msg.rs +++ b/ampd/src/handlers/mvx_verify_msg.rs @@ -152,7 +152,7 @@ mod tests { use cosmrs::cosmwasm::MsgExecuteContract; use cosmrs::tx::Msg; use cosmwasm_std; - use error_stack::Result; + use ethers_core::types::H160; use hex::ToHex; use tokio::sync::watch; use tokio::test as async_test; @@ -160,22 +160,21 @@ mod tests { use super::PollStartedEvent; use crate::event_processor::EventHandler; - use crate::handlers::tests::into_structured_event; + use crate::handlers::tests::{into_structured_event, participants}; use crate::mvx::proxy::MockMvxProxy; - use crate::types::{EVMAddress, Hash, TMAddress}; + use crate::types::TMAddress; use crate::PREFIX; #[test] - fn should_deserialize_poll_started_event() { - let event: Result = into_structured_event( + fn mvx_verify_msg_should_deserialize_correct_event() { + let event: PollStartedEvent = into_structured_event( poll_started_event(participants(5, None)), &TMAddress::random(PREFIX), ) - .try_into(); + .try_into() + .unwrap(); - assert!(event.is_ok()); - - let event = event.unwrap(); + goldie::assert_debug!(&event); assert!(event.poll_id == 100u64.into()); assert!( @@ -331,16 +330,9 @@ mod tests { .parse() .unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + destination_address: format!("0x{:x}", H160::repeat_byte(2)).parse().unwrap(), + payload_hash: [1;32], }], } } - - fn participants(n: u8, worker: Option) -> Vec { - (0..n) - .map(|_| TMAddress::random(PREFIX)) - .chain(worker) - .collect() - } } diff --git a/ampd/src/handlers/mvx_verify_verifier_set.rs b/ampd/src/handlers/mvx_verify_verifier_set.rs index 7c15193aa..0e2e7780a 100644 --- a/ampd/src/handlers/mvx_verify_verifier_set.rs +++ b/ampd/src/handlers/mvx_verify_verifier_set.rs @@ -168,19 +168,21 @@ mod tests { use super::PollStartedEvent; use crate::event_processor::EventHandler; - use crate::handlers::tests::into_structured_event; + use crate::handlers::tests::{into_structured_event, participants}; use crate::mvx::proxy::MockMvxProxy; use crate::types::TMAddress; use crate::PREFIX; #[test] - fn should_deserialize_verifier_set_poll_started_event() { + fn mvx_verify_verifier_set_should_deserialize_correct_event() { let event: PollStartedEvent = assert_ok!(into_structured_event( verifier_set_poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ) .try_into()); + goldie::assert_debug!(&event); + assert!(event.poll_id == 100u64.into()); assert!( event.source_gateway_address.to_bech32_string().unwrap() @@ -196,7 +198,6 @@ mod tests { assert!(verifier_set.event_index == 1u32); assert!(verifier_set.verifier_set.signers.len() == 3); assert_eq!(verifier_set.verifier_set.threshold, Uint128::from(2u128)); - goldie::assert_json!(verifier_set.verifier_set.signers); } #[async_test] @@ -338,11 +339,4 @@ mod tests { }, } } - - fn participants(n: u8, worker: Option) -> Vec { - (0..n) - .map(|_| TMAddress::random(PREFIX)) - .chain(worker) - .collect() - } } diff --git a/ampd/src/handlers/stellar_verify_msg.rs b/ampd/src/handlers/stellar_verify_msg.rs index 29a3f1017..a51b3de13 100644 --- a/ampd/src/handlers/stellar_verify_msg.rs +++ b/ampd/src/handlers/stellar_verify_msg.rs @@ -175,6 +175,7 @@ mod tests { use cosmrs::cosmwasm::MsgExecuteContract; use cosmrs::tx::Msg; use error_stack::Result; + use ethers_core::types::H160; use events::Error::{DeserializationFailed, EventTypeMismatch}; use events::Event; use stellar_xdr::curr::ScAddress; @@ -186,7 +187,7 @@ mod tests { use crate::event_processor::EventHandler; use crate::handlers::tests::{into_structured_event, participants}; use crate::stellar::rpc_client::Client; - use crate::types::{EVMAddress, Hash, TMAddress}; + use crate::types::TMAddress; use crate::PREFIX; #[test] @@ -234,13 +235,14 @@ mod tests { } #[test] - fn should_deserialize_correct_event() { + fn stellar_verify_msg_should_deserialize_correct_event() { let event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); - let event: Result = event.try_into(); - assert!(event.is_ok()); + let event: PollStartedEvent = event.try_into().unwrap(); + + goldie::assert_debug!(event); } #[async_test] @@ -302,12 +304,10 @@ mod tests { metadata: PollMetadata { poll_id: "100".parse().unwrap(), source_chain: "stellar".parse().unwrap(), - source_gateway_address: ScAddress::Contract(stellar_xdr::curr::Hash::from( - Hash::random().0, - )) - .to_string() - .try_into() - .unwrap(), + source_gateway_address: ScAddress::Contract(stellar_xdr::curr::Hash::from([1; 32])) + .to_string() + .try_into() + .unwrap(), confirmation_height: 15, expires_at, participants: participants @@ -317,24 +317,22 @@ mod tests { }, messages: (0..2) .map(|i| { - let msg_id = HexTxHashAndEventIndex::new(Hash::random(), i as u64); + let msg_id = HexTxHashAndEventIndex::new([3; 32], i as u64); #[allow(deprecated)] // TODO: The below event uses the deprecated tx_id and event_index fields. Remove this attribute when those fields are removed TxEventConfirmation { tx_id: msg_id.tx_hash_as_hex(), event_index: u32::try_from(msg_id.event_index).unwrap(), message_id: msg_id.to_string().parse().unwrap(), - source_address: ScAddress::Contract(stellar_xdr::curr::Hash::from( - Hash::random().0, - )) - .to_string() - .try_into() - .unwrap(), + source_address: ScAddress::Contract(stellar_xdr::curr::Hash::from([2; 32])) + .to_string() + .try_into() + .unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()) + destination_address: format!("0x{:x}", H160::repeat_byte(i)) .parse() .unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + payload_hash: [i; 32], } }) .collect::>(), diff --git a/ampd/src/handlers/stellar_verify_verifier_set.rs b/ampd/src/handlers/stellar_verify_verifier_set.rs index 847de8506..2e6428b01 100644 --- a/ampd/src/handlers/stellar_verify_verifier_set.rs +++ b/ampd/src/handlers/stellar_verify_verifier_set.rs @@ -167,7 +167,7 @@ mod tests { use crate::event_processor::EventHandler; use crate::handlers::tests::{into_structured_event, participants}; use crate::stellar::rpc_client::Client; - use crate::types::{Hash, TMAddress}; + use crate::types::TMAddress; use crate::PREFIX; #[test] @@ -215,13 +215,14 @@ mod tests { } #[test] - fn should_deserialize_correct_event() { + fn stellar_verify_verifier_set_should_deserialize_correct_event() { let event: Event = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ); - let event: Result = event.try_into(); - assert!(event.is_ok()); + let event: PollStartedEvent = event.try_into().unwrap(); + + goldie::assert_debug!(event); } #[async_test] @@ -279,14 +280,12 @@ mod tests { } fn poll_started_event(participants: Vec, expires_at: u64) -> PollStarted { - let msg_id = HexTxHashAndEventIndex::new(Hash::random(), 0u64); + let msg_id = HexTxHashAndEventIndex::new([1; 32], 0u64); PollStarted::VerifierSet { metadata: PollMetadata { poll_id: "100".parse().unwrap(), source_chain: "stellar".parse().unwrap(), - source_gateway_address: ScAddress::Contract(stellar_xdr::curr::Hash::from( - Hash::random().0, - )) + source_gateway_address: ScAddress::Contract(stellar_xdr::curr::Hash::from([2; 32])) .to_string() .try_into() .unwrap(), diff --git a/ampd/src/handlers/sui_verify_msg.rs b/ampd/src/handlers/sui_verify_msg.rs index 542084ffc..37b10a14a 100644 --- a/ampd/src/handlers/sui_verify_msg.rs +++ b/ampd/src/handlers/sui_verify_msg.rs @@ -159,10 +159,11 @@ mod tests { use cosmrs::cosmwasm::MsgExecuteContract; use cosmrs::tx::Msg; use cosmwasm_std; - use error_stack::{Report, Result}; + use error_stack::Report; + use ethers_core::types::H160; use ethers_providers::ProviderError; use events::Event; - use sui_types::base_types::{SuiAddress, TransactionDigest}; + use sui_types::base_types::{SuiAddress, SUI_ADDRESS_LENGTH}; use tokio::sync::watch; use tokio::test as async_test; use voting_verifier::events::{PollMetadata, PollStarted, TxEventConfirmation}; @@ -170,21 +171,22 @@ mod tests { use super::PollStartedEvent; use crate::event_processor::EventHandler; use crate::handlers::errors::Error; - use crate::handlers::tests::into_structured_event; + use crate::handlers::tests::{into_structured_event, participants}; use crate::sui::json_rpc::MockSuiClient; - use crate::types::{EVMAddress, Hash, TMAddress}; + use crate::types::TMAddress; const PREFIX: &str = "axelar"; #[test] - fn should_deserialize_poll_started_event() { - let event: Result = into_structured_event( + fn sui_verify_msg_should_deserialize_correct_event() { + let event: PollStartedEvent = into_structured_event( poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ) - .try_into(); + .try_into() + .unwrap(); - assert!(event.is_ok()); + goldie::assert_debug!(event); } // Should not handle event if it is not a poll started event @@ -326,12 +328,13 @@ mod tests { } fn poll_started_event(participants: Vec, expires_at: u64) -> PollStarted { - let msg_id = Base58TxDigestAndEventIndex::new(TransactionDigest::random(), 0u64); + let msg_id = Base58TxDigestAndEventIndex::new([1; 32], 0u64); PollStarted::Messages { metadata: PollMetadata { poll_id: "100".parse().unwrap(), source_chain: "sui".parse().unwrap(), - source_gateway_address: SuiAddress::random_for_testing_only() + source_gateway_address: SuiAddress::from_bytes([3; SUI_ADDRESS_LENGTH]) + .unwrap() .to_string() .parse() .unwrap(), @@ -347,21 +350,15 @@ mod tests { tx_id: msg_id.tx_digest_as_base58(), event_index: u32::try_from(msg_id.event_index).unwrap(), message_id: msg_id.to_string().parse().unwrap(), - source_address: SuiAddress::random_for_testing_only() + source_address: SuiAddress::from_bytes([4; SUI_ADDRESS_LENGTH]) + .unwrap() .to_string() .parse() .unwrap(), destination_chain: "ethereum".parse().unwrap(), - destination_address: format!("0x{:x}", EVMAddress::random()).parse().unwrap(), - payload_hash: Hash::random().to_fixed_bytes(), + destination_address: format!("0x{:x}", H160::repeat_byte(3)).parse().unwrap(), + payload_hash: [2; 32], }], } } - - fn participants(n: u8, verifier: Option) -> Vec { - (0..n) - .map(|_| TMAddress::random(PREFIX)) - .chain(verifier) - .collect() - } } diff --git a/ampd/src/handlers/sui_verify_verifier_set.rs b/ampd/src/handlers/sui_verify_verifier_set.rs index 2b42d9d44..5f7164101 100644 --- a/ampd/src/handlers/sui_verify_verifier_set.rs +++ b/ampd/src/handlers/sui_verify_verifier_set.rs @@ -154,34 +154,33 @@ mod tests { use std::convert::TryInto; use axelar_wasm_std::msg_id::Base58TxDigestAndEventIndex; - use error_stack::{Report, Result}; + use error_stack::Report; use ethers_providers::ProviderError; use events::Event; use multisig::key::KeyType; use multisig::test::common::{build_verifier_set, ecdsa_test_data}; - use sui_types::base_types::{SuiAddress, TransactionDigest}; + use sui_types::base_types::{SuiAddress, SUI_ADDRESS_LENGTH}; use tokio::sync::watch; use tokio::test as async_test; use voting_verifier::events::{PollMetadata, PollStarted, VerifierSetConfirmation}; use super::PollStartedEvent; use crate::event_processor::EventHandler; - use crate::handlers::tests::into_structured_event; + use crate::handlers::tests::{into_structured_event, participants}; use crate::sui::json_rpc::MockSuiClient; use crate::types::TMAddress; use crate::PREFIX; #[test] - fn should_deserialize_verifier_set_poll_started_event() { - let participants = (0..5).map(|_| TMAddress::random(PREFIX)).collect(); - - let event: Result = into_structured_event( - verifier_set_poll_started_event(participants, 100), + fn sui_verify_verifier_set_should_deserialize_correct_event() { + let event: PollStartedEvent = into_structured_event( + verifier_set_poll_started_event(participants(5, None), 100), &TMAddress::random(PREFIX), ) - .try_into(); + .try_into() + .unwrap(); - assert!(event.is_ok()); + goldie::assert_debug!(event); } #[async_test] @@ -224,12 +223,13 @@ mod tests { participants: Vec, expires_at: u64, ) -> PollStarted { - let msg_id = Base58TxDigestAndEventIndex::new(TransactionDigest::random(), 0u64); + let msg_id = Base58TxDigestAndEventIndex::new([5; 32], 0u64); PollStarted::VerifierSet { metadata: PollMetadata { poll_id: "100".parse().unwrap(), source_chain: "sui".parse().unwrap(), - source_gateway_address: SuiAddress::random_for_testing_only() + source_gateway_address: SuiAddress::from_bytes([3; SUI_ADDRESS_LENGTH]) + .unwrap() .to_string() .parse() .unwrap(), diff --git a/ampd/src/handlers/testdata/evm_verify_msg_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/evm_verify_msg_should_deserialize_correct_event.golden new file mode 100644 index 000000000..cbe3b2161 --- /dev/null +++ b/ampd/src/handlers/testdata/evm_verify_msg_should_deserialize_correct_event.golden @@ -0,0 +1,177 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_chain: ChainName( + "ethereum", + ), + source_gateway_address: 0x4f4495243837681061c4743b74eedf548d5686a5, + confirmation_height: 15, + expires_at: 100, + messages: [ + Message { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + event_index: 0, + }, + destination_address: "0x0202020202020202020202020202020202020202", + destination_chain: ChainName( + "ethereum", + ), + source_address: 0x0101010101010101010101010101010101010101, + payload_hash: 0x0404040404040404040404040404040404040404040404040404040404040404, + }, + Message { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + ], + event_index: 1, + }, + destination_address: "0x0404040404040404040404040404040404040404", + destination_chain: ChainName( + "ethereum", + ), + source_address: 0x0303030303030303030303030303030303030303, + payload_hash: 0x0505050505050505050505050505050505050505050505050505050505050505, + }, + Message { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + event_index: 10, + }, + destination_address: "0x0606060606060606060606060606060606060606", + destination_chain: ChainName( + "ethereum", + ), + source_address: 0x0505050505050505050505050505050505050505, + payload_hash: 0x0606060606060606060606060606060606060606060606060606060606060606, + }, + ], + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/evm_verify_verifier_set_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/evm_verify_verifier_set_should_deserialize_correct_event.golden new file mode 100644 index 000000000..47ea79af2 --- /dev/null +++ b/ampd/src/handlers/testdata/evm_verify_verifier_set_should_deserialize_correct_event.golden @@ -0,0 +1,120 @@ +PollStartedEvent { + verifier_set: VerifierSetConfirmation { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + event_index: 100, + }, + verifier_set: VerifierSet { + signers: { + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey": Signer { + address: Addr( + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(02d530fb1b8fcfb978c37d8d74d4a79ca840a01df457e48a81bbe01bc962820921), + ), + }, + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3": Signer { + address: Addr( + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(0354f1838e4dbc30d4c612633b9dc54c06ead9723bb164afee0bcc516cbb156985), + ), + }, + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz": Signer { + address: Addr( + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(03c6dee9a36c078363104b04ace62841d441dc05848f7e1e31674b3c04e621f9dc), + ), + }, + }, + threshold: Uint128( + 2, + ), + created_at: 0, + }, + }, + poll_id: PollId( + Uint64( + 100, + ), + ), + source_chain: ChainName( + "ethereum", + ), + source_gateway_address: 0x4f4495243837681061c4743b74eedf548d5686a5, + expires_at: 100, + confirmation_height: 15, + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/mvx_verify_msg_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/mvx_verify_msg_should_deserialize_correct_event.golden new file mode 100644 index 000000000..731ec17c3 --- /dev/null +++ b/ampd/src/handlers/testdata/mvx_verify_msg_should_deserialize_correct_event.golden @@ -0,0 +1,48 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_gateway_address: erd1qqqqqqqqqqqqqpgqsvzyz88e8v8j6x3wquatxuztnxjwnw92kkls6rdtzx, + messages: [ + Message { + tx_id: 0xdfaf64de66510723f2efbacd7ead3c4f8c856aed1afc2cb30254552aeda47312, + event_index: 1, + destination_address: "0x0202020202020202020202020202020202020202", + destination_chain: ChainName( + "ethereum", + ), + source_address: erd1qqqqqqqqqqqqqpgqzqvm5ywqqf524efwrhr039tjs29w0qltkklsa05pk7, + payload_hash: 0x0101010101010101010101010101010101010101010101010101010101010101, + }, + ], + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], + expires_at: 100, +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/mvx_verify_verifier_set_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/mvx_verify_verifier_set_should_deserialize_correct_event.golden new file mode 100644 index 000000000..4b0d50ad2 --- /dev/null +++ b/ampd/src/handlers/testdata/mvx_verify_verifier_set_should_deserialize_correct_event.golden @@ -0,0 +1,81 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_gateway_address: erd1qqqqqqqqqqqqqpgqsvzyz88e8v8j6x3wquatxuztnxjwnw92kkls6rdtzx, + verifier_set: VerifierSetConfirmation { + tx_id: 0xdfaf64de66510723f2efbacd7ead3c4f8c856aed1afc2cb30254552aeda47312, + event_index: 1, + verifier_set: VerifierSet { + signers: { + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey": Signer { + address: Addr( + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(addc89f87bba5a4267ae308ade0e5571488836038c5955e80ceee1f92ab6dc90), + ), + }, + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3": Signer { + address: Addr( + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(aa91ac8c4e299502560308e1bc3e180d98152c2510cc6e2689c4d4cd40bacfbe), + ), + }, + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz": Signer { + address: Addr( + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(5e050b6d1aeffa8a0ea24df98dd6f13f23c67d2554ab2b57bbdcd4be90261f8b), + ), + }, + }, + threshold: Uint128( + 2, + ), + created_at: 0, + }, + }, + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], + expires_at: 100, +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/should_deserialize_verifier_set_poll_started_event.golden b/ampd/src/handlers/testdata/should_deserialize_verifier_set_poll_started_event.golden deleted file mode 100644 index f96b3d866..000000000 --- a/ampd/src/handlers/testdata/should_deserialize_verifier_set_poll_started_event.golden +++ /dev/null @@ -1,23 +0,0 @@ -{ - "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey": { - "address": "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey", - "weight": "1", - "pub_key": { - "ed25519": "addc89f87bba5a4267ae308ade0e5571488836038c5955e80ceee1f92ab6dc90" - } - }, - "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3": { - "address": "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3", - "weight": "1", - "pub_key": { - "ed25519": "aa91ac8c4e299502560308e1bc3e180d98152c2510cc6e2689c4d4cd40bacfbe" - } - }, - "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz": { - "address": "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz", - "weight": "1", - "pub_key": { - "ed25519": "5e050b6d1aeffa8a0ea24df98dd6f13f23c67d2554ab2b57bbdcd4be90261f8b" - } - } -} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/stellar_verify_msg_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/stellar_verify_msg_should_deserialize_correct_event.golden new file mode 100644 index 000000000..37bdf3e9c --- /dev/null +++ b/ampd/src/handlers/testdata/stellar_verify_msg_should_deserialize_correct_event.golden @@ -0,0 +1,145 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_chain: ChainName( + "stellar", + ), + source_gateway_address: Contract( + Hash(0101010101010101010101010101010101010101010101010101010101010101), + ), + expires_at: 100, + messages: [ + Message { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + event_index: 0, + }, + destination_address: ScString( + StringM(0x0000000000000000000000000000000000000000), + ), + destination_chain: ScString( + StringM(ethereum), + ), + source_address: Contract( + Hash(0202020202020202020202020202020202020202020202020202020202020202), + ), + payload_hash: ScBytes( + BytesM(0000000000000000000000000000000000000000000000000000000000000000), + ), + }, + Message { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + event_index: 1, + }, + destination_address: ScString( + StringM(0x0101010101010101010101010101010101010101), + ), + destination_chain: ScString( + StringM(ethereum), + ), + source_address: Contract( + Hash(0202020202020202020202020202020202020202020202020202020202020202), + ), + payload_hash: ScBytes( + BytesM(0101010101010101010101010101010101010101010101010101010101010101), + ), + }, + ], + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/stellar_verify_verifier_set_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/stellar_verify_verifier_set_should_deserialize_correct_event.golden new file mode 100644 index 000000000..e361664c3 --- /dev/null +++ b/ampd/src/handlers/testdata/stellar_verify_verifier_set_should_deserialize_correct_event.golden @@ -0,0 +1,118 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_gateway_address: Contract( + Hash(0202020202020202020202020202020202020202020202020202020202020202), + ), + verifier_set: VerifierSetConfirmation { + message_id: HexTxHashAndEventIndex { + tx_hash: [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + event_index: 0, + }, + verifier_set: VerifierSet { + signers: { + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey": Signer { + address: Addr( + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(addc89f87bba5a4267ae308ade0e5571488836038c5955e80ceee1f92ab6dc90), + ), + }, + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3": Signer { + address: Addr( + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(aa91ac8c4e299502560308e1bc3e180d98152c2510cc6e2689c4d4cd40bacfbe), + ), + }, + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz": Signer { + address: Addr( + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz", + ), + weight: Uint128( + 1, + ), + pub_key: Ed25519( + HexBinary(5e050b6d1aeffa8a0ea24df98dd6f13f23c67d2554ab2b57bbdcd4be90261f8b), + ), + }, + }, + threshold: Uint128( + 2, + ), + created_at: 0, + }, + }, + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], + expires_at: 100, +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/sui_verify_msg_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/sui_verify_msg_should_deserialize_correct_event.golden new file mode 100644 index 000000000..d0348c8e7 --- /dev/null +++ b/ampd/src/handlers/testdata/sui_verify_msg_should_deserialize_correct_event.golden @@ -0,0 +1,83 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_gateway_address: 0x0303030303030303030303030303030303030303030303030303030303030303, + messages: [ + Message { + message_id: Base58TxDigestAndEventIndex { + tx_digest: [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + event_index: 0, + }, + destination_address: "0x0303030303030303030303030303030303030303", + destination_chain: ChainName( + "ethereum", + ), + source_address: 0x0404040404040404040404040404040404040404040404040404040404040404, + payload_hash: 0x0202020202020202020202020202020202020202020202020202020202020202, + }, + ], + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], + expires_at: 100, +} \ No newline at end of file diff --git a/ampd/src/handlers/testdata/sui_verify_verifier_set_should_deserialize_correct_event.golden b/ampd/src/handlers/testdata/sui_verify_verifier_set_should_deserialize_correct_event.golden new file mode 100644 index 000000000..7fa83f63e --- /dev/null +++ b/ampd/src/handlers/testdata/sui_verify_verifier_set_should_deserialize_correct_event.golden @@ -0,0 +1,116 @@ +PollStartedEvent { + poll_id: PollId( + Uint64( + 100, + ), + ), + source_gateway_address: 0x0303030303030303030303030303030303030303030303030303030303030303, + verifier_set: VerifierSetConfirmation { + message_id: Base58TxDigestAndEventIndex { + tx_digest: [ + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + ], + event_index: 0, + }, + verifier_set: VerifierSet { + signers: { + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey": Signer { + address: Addr( + "cosmwasm12qeyytrx2drup9gptvcqg4l6jdthymmz2lpu40rk6evs5cazf2kss8u0ey", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(02d530fb1b8fcfb978c37d8d74d4a79ca840a01df457e48a81bbe01bc962820921), + ), + }, + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3": Signer { + address: Addr( + "cosmwasm1g6q4zg5fk2uyg2wnxrt63dc6p5w0ycng2tq98k5cgg0w4zngt3wqnynyv3", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(0354f1838e4dbc30d4c612633b9dc54c06ead9723bb164afee0bcc516cbb156985), + ), + }, + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz": Signer { + address: Addr( + "cosmwasm1jguu9vd3fty0cr949yawye8gj88n0rjvjtpxa7t93umqpn3j96mqr93mgz", + ), + weight: Uint128( + 1, + ), + pub_key: Ecdsa( + HexBinary(03c6dee9a36c078363104b04ace62841d441dc05848f7e1e31674b3c04e621f9dc), + ), + }, + }, + threshold: Uint128( + 2, + ), + created_at: 0, + }, + }, + participants: [ + TMAddress( + AccountId( + "axelar1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq87nk3s", + ), + ), + TMAddress( + AccountId( + "axelar1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpuxy7hs", + ), + ), + TMAddress( + AccountId( + "axelar1qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszg9nw3w", + ), + ), + TMAddress( + AccountId( + "axelar1qvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrnayxhw", + ), + ), + TMAddress( + AccountId( + "axelar1qszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyz29mj8", + ), + ), + ], + expires_at: 100, +} \ No newline at end of file