everx-labs / ever-sdk

Client Libraries in 13 languages for Everscale, TON, Venom and other TVM blockchains

Home Page:https://docs.everos.dev/ever-sdk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Invalid parameters: missing field `type` at line 1 column" -- for tests in Abi

GildedHonour opened this issue · comments

Library version: 1.0.0

I'm writting tests for Abi in Ruby by replicating the ones written in Rust https://github.com/tonlabs/TON-SDK/blob/master/ton_client/client/src/abi/tests.rs

I'll always get this, for encode and decode ones:

{"code"=>23, "message"=>"Invalid parameters: missing field `type` at line 1 column 612\nparams: [here is JSON]}

The fields type, where they exist in Events.abi.json, are being read and sent out, it can be seen in the full output:

{"code"=>23, "message"=>"Invalid parameters: missing field `type` at line 1 column 612\nparams: {\"abi\":{\"ABI version\":2,\"header\":[\"pubkey\",\"time\",\"expire\"],\"functions\":[{\"name\":\"emitValue\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"outputs\":[],\"id\":null},{\"name\":\"returnValue\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"outputs\":[{\"name\":\"value0\",\"type\":\"uint256\",\"components\":[]}],\"id\":null},{\"name\":\"sendAllMoney\",\"inputs\":[{\"name\":\"dest_addr\",\"type\":\"address\",\"components\":[]}],\"outputs\":[],\"id\":null},{\"name\":\"constructor\",\"inputs\":[],\"outputs\":[],\"id\":null}],\"events\":[{\"name\":\"EventThrown\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint256\",\"components\":[]}],\"id\":null}],\"data\":[]},\"address\":null,\"deploy_set\":{\"tvc\":\"te6ccgECFwEAAxUAAgE0BgEBAcACAgPPIAUDAQHeBAAD0CAAQdgAAAAAAAAA\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAIm/wD0pCAiwAGS9KDhiu1TWDD0\\noQkHAQr0pCD0oQgAAAIBIAwKAcj/fyHtRNAg10nCAY4Q0//TP9MA0X/4Yfhm\\n+GP4Yo4Y9AVwAYBA9A7yvdcL//hicPhjcPhmf/hh4tMAAY4dgQIA1xgg+QEB\\n0wABlNP/AwGTAvhC4iD4ZfkQ8qiV0wAB8nri0z8BCwBqjh74QyG5IJ8wIPgj\\ngQPoqIIIG3dAoLnekvhj4IA08jTY0x8B+CO88rnTHwHwAfhHbpLyPN4CASAS\\nDQIBIA8OAL26i1Xz/4QW6ONe1E0CDXScIBjhDT/9M/0wDRf/hh+Gb4Y/hijh\\nj0BXABgED0DvK91wv/+GJw+GNw+GZ/+GHi3vhG8nNx+GbR+AD4QsjL//hDzw\\ns/+EbPCwDJ7VR/+GeAIBIBEQAOW4gAa1vwgt0cJ9qJoaf/pn+mAaL/8MPwzf\\nDH8MW99IMrqaOh9IG/o/CKQN0kYOG98IV15cDJ8AGRk/YIQZGfChGdGggQH0\\nAAAAAAAAAAAAAAAAAAgZ4tkwIBAfYAYfCFkZf/8IeeFn/wjZ4WAZPaqP/wzw\\nAMW5k8Ki3wgt0cJ9qJoaf/pn+mAaL/8MPwzfDH8MW9rhv/K6mjoaf/v6PwAZ\\nEXuAAAAAAAAAAAAAAAACGeLZ8DnyOPLGL0Q54X/5Lj9gBh8IWRl//wh54Wf/\\nCNnhYBk9qo//DPACAUgWEwEJuLfFglAUAfz4QW6OE+1E0NP/0z/TANF/+GH4\\nZvhj+GLe1w3/ldTR0NP/39H4AMiL3AAAAAAAAAAAAAAAABDPFs+Bz5HHljF6\\nIc8L/8lx+wDIi9wAAAAAAAAAAAAAAAAQzxbPgc+SVviwSiHPC//JcfsAMPhC\\nyMv/+EPPCz/4Rs8LAMntVH8VAAT4ZwBy3HAi0NYCMdIAMNwhxwCS8jvgIdcN\\nH5LyPOFTEZLyO+HBBCKCEP////28sZLyPOAB8AH4R26S8jze\\n\",\"workchain_id\":null,\"initial_data\":null},\"call_set\":{\"function_name\":\"constructor\",\"header\":{\"expire\":1599458404,\"time\":1599458364291,\"pubkey\":\"4c7c408ff1ddebb8d6405ee979c716a14fdd6cc08124107a61d3c25597099499\"},\"input\":null},\"signer\":{\"type\":\"External\",\"public_key\":\"4c7c408ff1ddebb8d6405ee979c716a14fdd6cc08124107a61d3c25597099499\"},\"processing_try_index\":null}", "data"=>{"core_version"=>"1.0.0"}}

Hi, try to send in a such structure for 1.0.0:
{"abi": {"type": "Serialized", "value": "ABI JSON"}}

For 1.1.1
{"abi": {"type": "Contract", "value": "Serialized ABI JSON"}}
or
{"abi": {"type": "Json", "value": "ABI JSON String"}}

I was using a wrong Abi entity/class - AbiContract instead of Abi