Skip to content

JSON/Graphql: iota_view doesn't support vector<u8> #9732

@Thoralf-M

Description

@Thoralf-M

Bug description

Calling a move view call where the function has a vector as parameter doesn't work:
JSON RPC with node:

curl -X POST https://api.devnet.iota.cafe/   -H "Content-Type: application/json"   -d '{
    "jsonrpc": "2.0",
    "method": "iota_view",
    "params": {
      "function_name": "0x02::hash::blake2b256",
      "typeArgs": [],
      "callArgs": [
        "[0,1,2]"
      ]
    },
    "id": 1
  }' | jq .

graphql indexer:

curl --request POST \
    --header 'content-type: application/json' \
    --url 'https://graphql.devnet.iota.cafe/' \
    --data '{"query":"{\n  hash: moveViewCall(\n    functionName: \"0x2::hash::blake2b256\"\n    arguments: [\"[0,1,2]\"]\n  ) {\n    error\n    results\n  }\n}"}' 

fails with
{"data":null,"errors":[{"message":"ErrorObject { code: InternalError, message: \"ObjectID hex string must start with 0x.\", data: None }","locations":[{"line":2,"column":3}],"path":["hash"]}]}

@kodemartin said that it's likely caused by

// in terms of non-primitives we only currently support objects and "flat"
// (depth == 1) vectors of objects (but not, for example, vectors of
// references)

Context

Components (select all that apply):

  • iota-indexer
  • iota-json-rpc
  • iota-graphql-rpc
  • Other: __________

Issue type (select one):

  • JSON-RPC API bug (failing request, unexpected response, etc.)
  • Crate bug (logic bug, runtime error, performance issue, etc.)

Version & Environment

  • Environment (Mainnet, Testnet, Devnet, Local, other, etc.): Devnet

Steps to reproduce the bug

See above

Expected behaviour

Should work

Actual behaviour

Errors with ObjectID hex string must start with 0x. even though no ObjectID should be used here

Metadata

Metadata

Assignees

Labels

infrastructureIssues related to the Infrastructure Team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions