chaintope / tapyrus-signer

Tapyrus Signer reference implementation.
GNU General Public License v3.0
7 stars 8 forks source link

Happend JsonParse Error when received candidateblock. #5

Closed nakajo2011 closed 4 years ago

nakajo2011 commented 4 years ago

Description

I working tapyrus-core and 3 signer nodes with-in my laptop. When I got bellow error:

Received Invalid candidate block!!: sender: SignerID { pubkey: PublicKey { compressed: true, key: PublicKey(44ae4952b8ba7cc3d458e99f66dfe3ddd22bb178d2fc62b7de78233c1ea6dbb85eba326eade277b9ca07ea85a0fec4b5b8bd597cddddc1637468656db2f7ec1d) } }, error: JsonRpc(Json(Error("invalid type: boolean `true`, expected unit", line: 0, column: 0)))

but, I guess, looks like the testproposedblock is success. but, JSON parsing is failed.

JSON-RPC request: {"method":"testproposedblock","params":["000000203337de600bb2b0770aed067f77d1bb5ac2324250fd3a6d0a55d5a67ef7cb0b027a2444a22d20e5932c24f902f52c11247f3ed0fa9eecda1f474c2c96a5795df4f8a1597926f2b8473d9193e09f4e34077b3d02df29b19c47893c627e88d23d22d4bce55d0001020000000100000000000000000000000000000000000000000000000000000000000000000100000003510101ffffffff0200f2052a010000001976a914169d728df86741490ccf243ad27c89f25af2d41788ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000",true],"id":3,"jsonrpc":"2.0"}
[2019-12-03T01:39:33Z TRACE tapyrus_signer::rpc] JSON-RPC response: {"result":true,"error":null,"id":3,"jsonrpc":null}

Expect Work

Maybe, we need fix error that JSON Parsing. The JSON-Parser expect uint type but actual type in response is boolean.

Environment

tapyrus-core revision: 07e1fa7a144ae0c8f6f51672bcdb6df59531731f tapyrus-signer revision: 253f0ef68b1bf71bd9fc39a48397d688b291a5d0 OS: macOS Mojave 10.14.6 Rust: rustc 1.38.0 (625451e37 2019-09-23) cargo: cargo 1.38.0 (23ef9a4ef 2019-08-20)

Yamaguchi commented 4 years ago

Pull request #6 solves this issue.