From 559fabdf564d2b4c83bb08c42960e4b3786b0299 Mon Sep 17 00:00:00 2001 From: zemyblue Date: Sat, 11 May 2024 18:59:17 +0900 Subject: [PATCH] chore: add unittest for amino msg. --- x/fbridge/types/msgs_test.go | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/x/fbridge/types/msgs_test.go b/x/fbridge/types/msgs_test.go index e661fc4189..87166e0ad4 100644 --- a/x/fbridge/types/msgs_test.go +++ b/x/fbridge/types/msgs_test.go @@ -57,6 +57,57 @@ func TestAminoJSON(t *testing.T) { "/lbm.fbridge.v1.MsgTransfer", "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgTransfer\",\"value\":{\"amount\":\"1000000\",\"receiver\":\"0xf7bAc63fc7CEaCf0589F25454Ecf5C2ce904997c\",\"sender\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", }, + "MsgProvision": { + &fbridgetypes.MsgProvision{ + From: addrs[0], + Seq: uint64(1), + Sender: addrs[0], + Receiver: addrs[1], + Amount: sdk.NewInt(1000000), + }, + "/lbm.fbridge.v1.MsgProvision", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgProvision\",\"value\":{\"amount\":\"1000000\",\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"receiver\":\"link1aydj7vdxljxq7cn2dlkrhrcwf5py8dnuqp32qd\",\"sender\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"seq\":\"1\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, + "MsgHoldTransfer": { + &fbridgetypes.MsgHoldTransfer{ + From: addrs[0], + Seq: 100, + }, + "/lbm.fbridge.v1.MsgHoldTransfer", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgHoldTransfer\",\"value\":{\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"seq\":\"100\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, + "MsgReleaseTransfer": { + &fbridgetypes.MsgReleaseTransfer{ + From: addrs[0], + Seq: 200, + }, + "/lbm.fbridge.v1.MsgReleaseTransfer", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgReleaseTransfer\",\"value\":{\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"seq\":\"200\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, + "MsgRemoveProvision": { + &fbridgetypes.MsgRemoveProvision{ + From: addrs[0], + Seq: 300, + }, + "/lbm.fbridge.v1.MsgRemoveProvision", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgRemoveProvision\",\"value\":{\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"seq\":\"300\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, + "MsgClaimBatch": { + &fbridgetypes.MsgClaimBatch{ + From: addrs[0], + MaxClaims: 50, + }, + "/lbm.fbridge.v1.MsgClaimBatch", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgClaimBatch\",\"value\":{\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"max_claims\":\"50\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, + "MsgClaim": { + &fbridgetypes.MsgClaim{ + From: addrs[0], + Seq: 400, + }, + "/lbm.fbridge.v1.MsgClaim", + "{\"account_number\":\"1\",\"chain_id\":\"foo\",\"fee\":{\"amount\":[],\"gas\":\"0\"},\"memo\":\"memo\",\"msgs\":[{\"type\":\"lbm-sdk/MsgClaim\",\"value\":{\"from\":\"link1zf469e6y5zvsvkjz8vpr27j6txseyfnsh3ydze\",\"seq\":\"400\"}}],\"sequence\":\"1\",\"timeout_height\":\"1\"}", + }, "MsgSuggestRole": { &fbridgetypes.MsgSuggestRole{ From: addrs[0],