From 4144525378221ef7687bd521fde8c2d936209c88 Mon Sep 17 00:00:00 2001 From: srdtrk Date: Fri, 28 Jul 2023 13:43:19 +0200 Subject: [PATCH] imp(transfer_test): improved test styling and added new test case --- modules/apps/transfer/ibc_module_test.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/apps/transfer/ibc_module_test.go b/modules/apps/transfer/ibc_module_test.go index 6fd0335d503..d8e532632a4 100644 --- a/modules/apps/transfer/ibc_module_test.go +++ b/modules/apps/transfer/ibc_module_test.go @@ -246,8 +246,6 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { var ( sender = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() receiver = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() - denom = "transfer/channel-0/atom" - amount = "100" data []byte expPacketData types.FungibleTokenPacketData @@ -259,11 +257,11 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { expPass bool }{ { - "success: both callbacks", + "success: valid packet data with memo", func() { expPacketData = types.FungibleTokenPacketData{ - Denom: denom, - Amount: amount, + Denom: ibctesting.TestCoin.Denom, + Amount: ibctesting.TestCoin.Amount.String(), Sender: sender, Receiver: receiver, Memo: "some memo", @@ -272,6 +270,20 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { }, true, }, + { + "success: valid packet data without memo", + func() { + expPacketData = types.FungibleTokenPacketData{ + Denom: ibctesting.TestCoin.Denom, + Amount: ibctesting.TestCoin.Amount.String(), + Sender: sender, + Receiver: receiver, + Memo: "", + } + data = expPacketData.GetBytes() + }, + true, + }, { "failure: invalid packet data", func() {