Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

[Bug] TAPOS validation fails for ref_block_num of 0 #554

@zquestz

Description

@zquestz

Version of EOSJS
Latest

Describe the bug
There appears to be a bug in eos-api.ts where hasRequiredTaposFields returns false if ref_block_num is equal to 0. We noticed a failed transaction where the block number was 61931520. This caused refBlock.block_num & 0xffff in eosjs-serialize.ts to return 0 and then the subsequent transaction failed to get signed.

To Reproduce
Steps to reproduce the behavior:

  1. Generate an unsigned transaction for a block where refBlock.block_num & 0xffff equals zero. This is any block divisible by 65536.
  2. Try to sign the transaction
  3. Watch the signing fail due to hasRequiredTaposFields returning false!

Expected behavior
The transaction is valid when ref_block_num is zero.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions