Skip to content

Commit 7c015b4

Browse files
authored
Merge pull request #2274 from oasisprotocol/mz/fix-signer
Replace removed GetSignerNonce RPC with stakingAccount
2 parents 13ae2d7 + 565ab50 commit 7c015b4

4 files changed

Lines changed: 5 additions & 27 deletions

File tree

.changelog/2274.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replace removed GetSignerNonce RPC with stakingAccount

playwright/tests/oasis-scan-v2.spec.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

playwright/utils/mockApi.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,7 @@ export async function mockApi(context: BrowserContext | Page, balance: number |
9191
await context.route('**/oasis-core.Staking/Account', route => {
9292
route.fulfill({
9393
contentType: 'application/grpc-web-text+proto',
94-
body: 'AAAAAAGggAAAAB5ncnBjLXN0YXR1czowDQpncnBjLW1lc3NhZ2U6DQo=',
95-
})
96-
})
97-
await context.route('**/oasis-core.Consensus/GetSignerNonce', route => {
98-
route.fulfill({
99-
contentType: 'application/grpc-web-text+proto',
100-
body: 'AAAAAAIYKQ==gAAAAB5ncnBjLXN0YXR1czowDQpncnBjLW1lc3NhZ2U6DQo=',
94+
body: 'AAAAABKhZ2dlbmVyYWyhZW5vbmNlGCk=gAAAAB5ncnBjLXN0YXR1czowDQpncnBjLW1lc3NhZ2U6DQo=',
10195
})
10296
})
10397
await context.route('**/oasis-core.Consensus/EstimateGas', route => {

src/app/lib/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ export class OasisTransaction {
210210
}
211211

212212
protected static async getNonce(nic: OasisClient, signer: Signer): Promise<bigint> {
213-
const nonce = await nic.consensusGetSignerNonce({
214-
account_address: await shortPublicKey(signer.public()),
213+
const account = await nic.stakingAccount({
214+
owner: await shortPublicKey(signer.public()),
215215
height: 0,
216216
})
217217

218-
return BigInt(nonce || 0)
218+
return BigInt(account?.general?.nonce ?? 0)
219219
}
220220
}

0 commit comments

Comments
 (0)