Giter Club home page Giter Club logo

Comments (5)

brenzi avatar brenzi commented on September 15, 2024

right now ouy'd get

[2019-09-09T10:35:59Z ERROR substrate_api_client::rpc::client] ERROR: Object({"code": Number(1010), "data": String("BadProof"), "message": String("Invalid Transaction")})

from substrate-api-client.

brenzi avatar brenzi commented on September 15, 2024

started work on branch brenzi-upstream-sync

first trouble here:

2019-09-09T13:25:29Z INFO  substrate_api_client::rpc::client] sending request: {"id":"1","jsonrpc":"2.0","method":"state_getRuntimeVersion","params":null}
[2019-09-09T13:25:29Z DEBUG ws::handler] Handler received: 
<FRAME>
final: true
reserved: false false false
opcode: TEXT
length: 344
payload length: 340
payload: 0x7b226a736f6e727063223a22322e30222c22726573756c74223a7b2261706973223a5b5b22307864663661636236383939303736303962222c325d2c5b22307833376533393766633763393166356534222c315d2c5b22307834306665336164343031663839353961222c335d2c5b22307864326263393839376565643038663135222c315d2c5b22307866373862323738626535336634353463222c315d2c5b22307865643939633561636232356565646635222c325d2c5b22307863626361323565333966313432333837222c315d2c5b22307861623363303537323239316665623862222c315d5d2c22617574686f72696e6756657273696f6e223a332c22696d706c4e616d65223a22746573742d6e6f6465222c22696d706c56657273696f6e223a342c22737065634e616d65223a226e6f6465222c227370656356657273696f6e223a347d2c226964223a2231227d
            
[2019-09-09T13:25:29Z INFO  substrate_api_client::rpc::client] got message
[2019-09-09T13:25:29Z DEBUG substrate_api_client::rpc::client] {"jsonrpc":"2.0","result":{"apis":[["0xdf6acb689907609b",2],["0x37e397fc7c91f5e4",1],["0x40fe3ad401f8959a",3],["0xd2bc9897eed08f15",1],["0xf78b278be53f454c",1],["0xed99c5acb25eedf5",2],["0xcbca25e39f142387",1],["0xab3c0572291feb8b",1]],"authoringVersion":3,"implName":"test-node","implVersion":4,"specName":"node","specVersion":4},"id":"1"}
[2019-09-09T13:25:29Z DEBUG substrate_api_client] got the following runtime version (raw): 0x00
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("Error decoding field RuntimeVersion.spec_name")', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[2019-09-09T13:25:29Z DEBUG ws::handler] Handler received: 
<FRAME>
final: true
reserved: false false false
opcode: CLOSE
length: 4
payload length: 2
payload: 0x3e8
            
[2019-09-09T13:25:29Z DEBUG ws::handler] Connection closing due to (Normal) 
[2019-09-09T13:25:29Z DEBUG ws::io] WebSocket connection to 127.0.0.1:9944 disconnected.

observation: metadata can directly be decoded by parity-scale-codec, as it is returned as a vec of bytes.

runtime version is returned as json string and can't be decoded as such

BUT: why is the returned value 0x00 ?

[2019-09-09T13:25:29Z DEBUG substrate_api_client] got the following runtime version (raw): 0x00

from substrate-api-client.

brenzi avatar brenzi commented on September 15, 2024

the problem is that the response can't be returned as a string at

let hexstr = match value["result"].as_str() {

Probably the whole approach was flawed. I guess the runtime version shouldn't be queried dynamically, but rather hard-coded to ensure breaking changes are fixed by devs using the api.
therefore, we shouldn't query RuntimeVersion over RPC but rather use the dependency on our runtime.

from substrate-api-client.

brenzi avatar brenzi commented on September 15, 2024

when I now try to send an extrinsic, I get

RUST_LOG=debug cargo run --example example_transfer
....
[2019-09-09T14:40:42Z INFO  substrate_api_client::rpc::client] sending request: {"id":"3","jsonrpc":"2.0","method":"author_submitAndWatchExtrinsic","params":["0x2d0283ffd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d66fc5a9b30434dd245451ece2edd99c9a21b4245f48a56a2b0b40931d80e7b3161aa6ae3ab765cde2690ab39342c31fd8eb90a7527de1f05ae8a2197e93ea284100000000500ff8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48a10f"]}
[2019-09-09T14:40:42Z DEBUG ws::handler] Handler received: 
<FRAME>
final: true
reserved: false false false
opcode: TEXT
length: 255
payload length: 251
payload: 0x7b226a736f6e727063223a22322e30222c226572726f72223a7b22636f6465223a313030322c226d657373616765223a22566572696669636174696f6e204572726f723a20457865637574696f6e3a20436f756c64206e6f7420636f6e7665727420706172616d657465722060747860206265747765656e206e6f646520616e642072756e74696d6521222c2264617461223a22436c69656e7428457865637574696f6e284170694572726f72285c22436f756c64206e6f7420636f6e7665727420706172616d657465722060747860206265747765656e206e6f646520616e642072756e74696d65215c22292929227d2c226964223a2233227d
            
[2019-09-09T14:40:42Z INFO  substrate_api_client::rpc::client] got message
[2019-09-09T14:40:42Z DEBUG substrate_api_client::rpc::client] {"jsonrpc":"2.0","error":{"code":1002,"message":"Verification Error: Execution: Could not convert parameter `tx` between node and runtime!","data":"Client(Execution(ApiError(\"Could not convert parameter `tx` between node and runtime!\")))"},"id":"3"}
[2019-09-09T14:40:42Z ERROR substrate_api_client::rpc::client] ERROR: Object({"code": Number(1002), "data": String("Client(Execution(ApiError(\"Could not convert parameter `tx` between node and runtime!\")))"), "message": String("Verification Error: Execution: Could not convert parameter `tx` between node and runtime!")})

reproduce with
6c03f7e

from substrate-api-client.

clangenb avatar clangenb commented on September 15, 2024

Fixed in #17

from substrate-api-client.

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.