Located bug.

Example output:
from query: account: number = 4, sequence = 0
for signing: nonce: 0
This commit is contained in:
Ethan Frey 2020-01-23 14:45:38 +01:00
parent ae1534896d
commit 95722a0495
2 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,8 @@ export class CosmosCodec implements TxCodec {
}
public bytesToSign(unsigned: UnsignedTransaction, nonce: Nonce): SigningJob {
console.log("nonce:", nonce);
// ohhh... this is a bug!!!
const accountNumber = 0;
const memo = (unsigned as any).memo;
const built = buildUnsignedTx(unsigned, this.tokens);

View File

@ -171,6 +171,7 @@ export class CosmosConnection implements BlockchainConnection {
const address = isPubkeyQuery(query) ? pubkeyToAddress(query.pubkey, this.prefix) : query.address;
const { result } = await this.restClient.authAccounts(address);
const account = result.value;
console.log(`account: number = ${account.account_number}, sequence = ${account.sequence}`);
return parseInt(account.sequence, 10) as Nonce;
}