Giter Site home page Giter Site logo

Comments (3)

heifner avatar heifner commented on August 12, 2024

cleos leap v3.1.x works. cleos version: v2.1.0 is not supported, but cleos leap main branch has a similar issue as cleos version: v2.1.0 as it modifies the JSON in a similar way as v2.1.0.

from leap.

heifner avatar heifner commented on August 12, 2024

The eosio.msig contract ABI expects the transaction "data" as a hex string.

    "structs": [{
        "name": "action",
        "base": "",
        "fields": [{
            "name": "account",
            "type": "name"
          },{
            "name": "name",
            "type": "name"
          },{
            "name": "authorization",
            "type": "permission_level[]"
          },{
            "name": "data",
            "type": "bytes"
          }
        ]
      }

cleos leap v3.1.x produces a transfer.json in the correct format.

{
  "expiration": "2022-11-11T10:24:24",
  "ref_block_num": 41363,
  "ref_block_prefix": 937202845,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio.token",
      "name": "transfer",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": "0000000000ea305500408c7a02ea3055102700000000000004454f53000000000f70726f706f7365206173204d534947"
    }
  ],
  "transaction_extensions": [],
  "signatures": [],
  "context_free_data": []
}

cleos leap main branch expands the "data" section providing an unexpected "data" section.

{
  "expiration": "2022-11-11T09:57:49",
  "ref_block_num": 38171,
  "ref_block_prefix": 3147693954,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio.token",
      "name": "transfer",
      "authorization": [{
          "actor": "eosio",
          "permission": "active"
        }
      ],
      "data": {
        "from": "eosio",
        "to": "eosio.null",
        "quantity": "1.0000 EOS",
        "memo": "propose as MSIG"
      },
      "hex_data": "0000000000ea305500408c7a02ea3055102700000000000004454f53000000000f70726f706f7365206173204d534947"
    }
  ],
  "transaction_extensions": [],
  "signatures": [],
  "context_free_data": []
}

Removing the "data" section is not the correct approach as that will generate an empty action which will fail to execute.

from leap.

heifner avatar heifner commented on August 12, 2024

The work-around is to remove the "data" section and rename "hex_data" to "data".
If using cleos v2.1.x, also will need to add "transaction_extensions": [], to the generated transaction JSON.

from leap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.