Skip to content

Commit

Permalink
fix: add nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvalabs-harshrastogi committed Nov 30, 2023
1 parent fda7844 commit ab6af57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/js-moi-logic/src/logic-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export abstract class LogicBase extends ElementDescriptor {
type: this.getIxType(),
fuel_price: args[1].fuelPrice,
fuel_limit: args[1].fuelLimit,
payload: ixObject.createPayload()
payload: ixObject.createPayload(),
nonce: args[1].nonce
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions packages/js-moi-signer/src/signer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AbstractProvider, Options, InteractionResponse, InteractionRequest, CallorEstimateIxObject, InteractionCallResponse, InteractionObject } from "js-moi-providers";
import ECDSA_S256 from "./ecdsa";
import { AbstractProvider, CallorEstimateIxObject, InteractionCallResponse, InteractionObject, InteractionRequest, InteractionResponse, Options } from "js-moi-providers";
import { ErrorCode, ErrorUtils, IxType, hexToBytes, isValidAddress } from "js-moi-utils";
import { SigType, SigningAlgorithms } from "../types";
import ECDSA_S256 from "./ecdsa";
import Signature from "./signature";
import { ErrorCode, ErrorUtils, hexToBytes, IxType, isValidAddress } from "js-moi-utils";

/**
* An abstract class representing a signer responsible for cryptographic
Expand Down Expand Up @@ -126,7 +126,9 @@ export abstract class Signer {
* an error during preparation.
*/
private async prepareInteraction(ixObject: InteractionObject): Promise<void> {
const nonce = await this.getNonce();
const nonce = await this.getNonce({
tesseract_number: -1,
});

if (!ixObject.sender) {
ixObject.sender = this.getAddress();
Expand Down

0 comments on commit ab6af57

Please sign in to comment.