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

🐛 [BUG] - Transaction validation #1735

Open
HiiiiD opened this issue Jan 22, 2025 · 0 comments
Open

🐛 [BUG] - Transaction validation #1735

HiiiiD opened this issue Jan 22, 2025 · 0 comments

Comments

@HiiiiD
Copy link

HiiiiD commented Jan 22, 2025

Description

Transaction.of() validation will break when using signerUtils.transactionBodyToTransactionRequestInput when dependsOn is set to null

Reproduction URL

No response

Reproduction steps

1. Create a transaction body like this one (`dependsOn` is set to null): 

{
      blockRef: '0x0000000000000000',
      chainTag: 16,
      clauses: [
        {
          to: '0x0000000000000000000000000000000000000001',
          value: '0x0',
          data: '0x1234'
        },
        {
          to: '0x0000000000000000000000000000000000000001',
          value: '0x0',
          data: '0x1234'
        }
      ],
      dependsOn: null,
      expiration: 32768,
      gas: 62762,
      gasPriceCoef: 128,
      nonce: 2876988663801153,
      reserved: undefined
    }

2. When passing this value to `signerUtils.transactionBodyToTransactionRequestInput`, the output is:

{
      from: undefined,
      chainTag: 16,
      blockRef: '0x0000000000000000',
      expiration: 32768,
      clauses: [
        {
          to: '0x0000000000000000000000000000000000000001',
          value: '0x0',
          data: '0x1234'
        },
        {
          to: '0x0000000000000000000000000000000000000001',
          value: '0x0',
          data: '0x1234'
        }
      ],
      gasPriceCoef: 128,
      gas: 62762,
      dependsOn: undefined,
      nonce: 2876988663801153,
      reserved: undefined
    }

3. If this output is then passed to `Transaction.of`, internally it'll call Transaction.isValidBody, which will throw an error for a malformed body since `dependsOn` is `undefined`

Screenshots

![DESCRIPTION](LINK.png)

Logs

OS

Windows

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

1 participant