Skip to content

Commit 084cd52

Browse files
friedemannfcfal
authored andcommitted
Fix msghasher append
1 parent 55a4c81 commit 084cd52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/capabilities/ccip/ccipaptos/msghasher.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (h *MessageHasherV1) Hash(ctx context.Context, msg cciptypes.Message) (ccip
6666
lggr.Debugw("hashing message", "msg", msg)
6767

6868
rampTokenAmounts := make([]any2AptosTokenTransfer, len(msg.TokenAmounts))
69-
for _, rta := range msg.TokenAmounts {
69+
for i, rta := range msg.TokenAmounts {
7070
destGasAmount, err := abiDecodeUint32(rta.DestExecData)
7171
if err != nil {
7272
return [32]byte{}, fmt.Errorf("decode dest gas amount: %w", err)
@@ -83,13 +83,13 @@ func (h *MessageHasherV1) Hash(ctx context.Context, msg cciptypes.Message) (ccip
8383
lggr.Debugw("abi decoded dest token address",
8484
"destTokenAddress", destTokenAddress)
8585

86-
rampTokenAmounts = append(rampTokenAmounts, any2AptosTokenTransfer{
86+
rampTokenAmounts[i] = any2AptosTokenTransfer{
8787
SourcePoolAddress: rta.SourcePoolAddress,
8888
DestTokenAddress: destTokenAddress,
8989
DestGasAmount: destGasAmount,
9090
ExtraData: rta.ExtraData,
9191
Amount: rta.Amount.Int,
92-
})
92+
}
9393
}
9494

9595
// one difference from EVM is that we don't left pad the OnRamp to 32 bytes here, we use the source chain's canonical bytes encoding directly.

0 commit comments

Comments
 (0)