Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiSig - Propose to change on the overrides logic process #25

Open
githubckgoh1439 opened this issue May 4, 2020 · 2 comments
Open

Comments

@githubckgoh1439
Copy link

Hi, YK

While come to Create-multisig-Tx and Sign-multisig-Tx in those test-cases, I will set this :

let overrides = {
    accountNumber: multiSigWallet.multisigAccountState.value.accountNumber,
    nonce: 0           
}

So, I will base on this below :

// Removing multisig signature elements, so that it will be using wallet signature instead of multisig.
if (overrides && overrides["accountNumber"]) {
   delete overrides["accountNumber"];
   if (!silent) console.log(indent, "\nsendRawTransaction()........delete overrides[accountNumber]");
}
if (overrides && overrides["nonce"]) {
   delete overrides["nonce"];
   if (!silent) console.log(indent, "\nsendRawTransaction()........delete overrides[nonce]");
}

And change to this below :

// Removing multisig signature elements, so that it will be using wallet signature instead of multisig.
if (overrides && overrides["accountNumber"]) {
   delete overrides["accountNumber"];
   delete overrides["nonce"];
}

Because while I do debugging it always skip this selection 'if (overrides && overrides["nonce"])', even I set like this :

let overrides = {
    accountNumber: multiSigWallet.multisigAccountState.value.accountNumber,
    nonce: 0           
}

Any comments ?

@b00f
Copy link
Contributor

b00f commented May 4, 2020

Your change look a bit dangerous. Because you try to override the nonce even it is not requested.

Because while I do debugging it always skip this selection 'if (overrides && overrides["nonce"])', even I set like this :

The reason might be you set nonce to zero: nonce: 0

changing
if (overrides && overrides["nonce"]) {
to
if (overrides && overrides["nonce"] !== null) {
will fix your issue.

The !== check both value and type. In this case 0 !=== null.

@githubckgoh1439
Copy link
Author

githubckgoh1439 commented May 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants