From a6a8854598b6122946e4794bede7ef43b386743a Mon Sep 17 00:00:00 2001 From: Tien Nguyen Date: Thu, 18 Jan 2024 02:29:01 +0700 Subject: [PATCH] fix: Add check len msgs when process proposal (#1437) ## Summary by CodeRabbit - **Bug Fixes** - Improved transaction message processing by ensuring at exactly one message is present before unwrapping the payload. --- cosmos/runtime/chain/abci.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cosmos/runtime/chain/abci.go b/cosmos/runtime/chain/abci.go index dcc69eb6a..c83cfe996 100644 --- a/cosmos/runtime/chain/abci.go +++ b/cosmos/runtime/chain/abci.go @@ -51,10 +51,12 @@ func (wbc *WrappedBlockchain) ProcessProposal( continue } - protoEnvelope := sdkTx.GetMsgs()[0] - if env, ok := protoEnvelope.(*evmtypes.WrappedPayloadEnvelope); ok { - envelope = env.UnwrapPayload() - break + if len(sdkTx.GetMsgs()) == 1 { + protoEnvelope := sdkTx.GetMsgs()[0] + if env, ok := protoEnvelope.(*evmtypes.WrappedPayloadEnvelope); ok { + envelope = env.UnwrapPayload() + break + } } }