Skip to content

Commit

Permalink
fix: Leave payload as byte array instead of coverting to int array
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Feb 2, 2024
1 parent e90242c commit 0b059f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions x/gmp/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,12 @@ func (k Keeper) BuildGmpRequest(
if err != nil {
return nil, err
}
intPayload := make([]int, len(payload))
for i, b := range payload {
intPayload[i] = int(b)
}

// package GMP
message := types.GmpMessage{
DestinationChain: msg.DestinationChain,
DestinationAddress: msg.OjoContractAddress,
Payload: intPayload,
Payload: payload,
Type: types.TypeGeneralMessage,
Fee: &types.GmpFee{
Amount: msg.Token.Amount.String(),
Expand Down
2 changes: 1 addition & 1 deletion x/gmp/types/gmp_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type GmpMessage struct {
// DestinationAddress is the destination address of the message
DestinationAddress string `json:"destination_address"`
// Payload is the encoded payload of the message (exchange rates)
Payload []int `json:"payload"`
Payload []byte `json:"payload"`
// Type is an enum that specifies the type of message
Type int64 `json:"type"`
// Fee is the fee paid to a relayer on the Axelar network
Expand Down
6 changes: 1 addition & 5 deletions x/gmp/types/gmp_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ func TestUnmarshalIntoAxelarMessage(t *testing.T) {
)
payload, err := encoder.GMPEncode()
require.NoError(t, err)
intPayload := make([]int, len(payload))
for i, b := range payload {
intPayload[i] = int(b)
}

message := GmpMessage{
DestinationChain: "base",
DestinationAddress: "0xa97Abf29D45DEDD18612f181383fC127da1cAa8d",
Payload: intPayload,
Payload: payload,
Type: 1,
Fee: &GmpFee{
Amount: "100000000000",
Expand Down

0 comments on commit 0b059f5

Please sign in to comment.