Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
fix: Add check len msgs when process proposal (#1437)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved transaction message processing by ensuring at exactly one
message is present before unwrapping the payload.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
tnv1 committed Jan 17, 2024
1 parent 859c8d7 commit a6a8854
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cosmos/runtime/chain/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit a6a8854

Please sign in to comment.