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

Cannot serialize transaction when using valid type #1627

Closed
FrederikBolding opened this issue May 29, 2021 · 1 comment
Closed

Cannot serialize transaction when using valid type #1627

FrederikBolding opened this issue May 29, 2021 · 1 comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@FrederikBolding
Copy link

FrederikBolding commented May 29, 2021

Describe the bug
Calling serialize on a Transaction with type equals null, results in an error being thrown because checkProperties doesn't expect type.

Reproduction steps

const transaction = {
      to: '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520',
      value: BigNumber.from('0x0'),
      data: '0x',
      chainId: 1,
      gasLimit: BigNumber.from('0x5208'),
      gasPrice: BigNumber.from('0x1'),
      nonce: 1,
      r: '0x7e833413ead52b8c538001b12ab5a85bac88db0b34b61251bb0fc81573ca093f',
      s: '0x49634f1e439e3760265888434a2f9782928362412030db1429458ddc9dcee995',
      v: 37,
      type: null
    };
 const { r, s, v, ...unsignedTransaction } = transaction;
 const serializedTransaction = serialize(unsignedTransaction, { r, s, v });

Running the above code results in the following error:

invalid object key - type (argument="transaction:type", value={"to":"0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520","value":{"type":"BigNumber","hex":"0x00"},"data":"0x","chainId":1,"gasLimit":{"type":"BigNumber","hex":"0x5208"},"gasPrice":{"type":"BigNumber","hex":"0x01"},"nonce":1,"type":null}, code=INVALID_ARGUMENT, version=properties/5.1.0)
@FrederikBolding FrederikBolding added the investigate Under investigation and may be a bug. label May 29, 2021
@ricmoo
Copy link
Member

ricmoo commented Jun 26, 2021

This has been fixed in 5.4.0. Try it out and let me know if you still have any issues. :)

@ricmoo ricmoo closed this as completed Jun 26, 2021
@ricmoo ricmoo reopened this Jun 26, 2021
@ricmoo ricmoo added bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. and removed investigate Under investigation and may be a bug. labels Jun 26, 2021
@ricmoo ricmoo closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants