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.

Inconsistent behaviors between eosio::chain::abi_serializer and eosjs-serialize #823

@conr2d

Description

@conr2d

Version of EOSJS
v21.0.3

Describe the bug
eosio::chain::abi_serializer puts built-in types first, so even if user defines new type with built-in type name, it would be ignored. However, eosjs instantiates built-in types by createInitialTypes(), but it would be overwritten by types read from abi. It would be better to keep consistency between two serializers.

To Reproduce
Steps to reproduce the behavior:

  1. Define new type with built-in type name in contract ABI like:
  "types": [
    {
      "new_type_name": "bytes",
      "type": "checksum256"
    }
  ],
  1. Send an action including argument with the user-defined new type
  • cleos: cleos uses eosio::chain::abi_serializer, so bytes still follows the serialization rule of built-in type bytes.
  • eosjs: eosjs overwrites built-in type serializer with user-defined one, so it would be serialized like checksum256 here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions