Skip to content

Commit

Permalink
fix!: remove unnecessary nonce from message gql queries (#3298)
Browse files Browse the repository at this point in the history
  • Loading branch information
maschad authored Nov 13, 2024
1 parent 63a34f6 commit f607ba2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-camels-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": minor
---

fix!: remove unnecessary nonce from message gql queries
9 changes: 6 additions & 3 deletions packages/account/src/providers/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,14 @@ fragment messageFragment on Message {
sender
recipient
data
nonce
daHeight
}

fragment getMessageFragment on Message {
...messageFragment
nonce
}

fragment messageProofFragment on MessageProof {
messageProof {
proofSet
Expand Down Expand Up @@ -312,7 +316,6 @@ fragment messageProofFragment on MessageProof {
}
sender
recipient
nonce
amount
data
}
Expand Down Expand Up @@ -698,7 +701,7 @@ query getMessages(
}
edges {
node {
...messageFragment
...getMessageFragment
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/providers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2068,13 +2068,13 @@ Supported fuel-core version: ${supportedVersion}.`
messageId: InputMessageCoder.getMessageId({
sender: rawMessage.sender,
recipient: rawMessage.recipient,
nonce: rawMessage.nonce,
nonce,
amount: bn(rawMessage.amount),
data: rawMessage.data,
}),
sender: Address.fromAddressOrString(rawMessage.sender),
recipient: Address.fromAddressOrString(rawMessage.recipient),
nonce: rawMessage.nonce,
nonce,
amount: bn(rawMessage.amount),
data: InputMessageCoder.decodeData(rawMessage.data),
daHeight: bn(rawMessage.daHeight),
Expand Down
3 changes: 1 addition & 2 deletions packages/account/test/fixtures/messageProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const MESSAGE_PROOF_RAW_RESPONSE: GqlGetMessageProofQuery['messageProof']
},
sender: '0x79c54219a5c910979e5e4c2728df163fa654a1fe03843e6af59daa2c3fcd42ea',
recipient: '0x00000000000000000000000047ba61eec8e5e65247d717ff236f504cf3b0a263',
nonce: '0x3e87e0f44613cabecd1aad381ad41a433afb12ec5c54c172de3db25b1b4d1b53',
amount: '10',
data: '0x',
};
Expand Down Expand Up @@ -110,7 +109,7 @@ export const MESSAGE_PROOF: MessageProof = {
},
sender: Address.fromAddressOrString(MESSAGE_PROOF_RAW_RESPONSE.sender),
recipient: Address.fromAddressOrString(MESSAGE_PROOF_RAW_RESPONSE.recipient),
nonce: MESSAGE_PROOF_RAW_RESPONSE.nonce,
nonce: '0xb33895e6fdf23b5a62c92a1d45c71a11579027f9e5c4dda73c26cf140bcd6895',
amount: bn(MESSAGE_PROOF_RAW_RESPONSE.amount),
data: MESSAGE_PROOF_RAW_RESPONSE.data,
};

0 comments on commit f607ba2

Please sign in to comment.