Author Topic: [api] bizarre get_block error  (Read 1916 times)

0 Members and 1 Guest are viewing this topic.

Offline monsterer

Many thanks guys - that was indeed the solution :)
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array


I'm with abit - this looks suspiciously like the API change we'd seen in BitShares in February.

get_block 4658091 works for me in the cli_wallet as well as via curl. Most likely your client is not compatible with the latest node.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
This is occuring on the MUSE chain, for some reason, calling the get_block() api call on certain blocks has started failing with a strange error:

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:530 get_array,data:{code:7,name:bad_cast_exception,message:Bad Cast,stack:[{context:{level:error,file:variant.cpp,line:53
0,method:get_array,hostname:,thread_name:th_a,timestamp:2016-04-09T20:28:59},format:Invalid cast from ${type} to Array,data:{type:object_type}}
]}}

If I call the function on the prior block it returns fine. Any ideas what could be causing this?
Using an old cli_wallet with new witness_node? I guess it's caused by serialization changes on the extensions struct. Just guess, don't count on me.  :P
BitShares committee member: abit
BitShares witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline monsterer

This is occuring on the MUSE chain, for some reason, calling the get_block() api call on certain blocks has started failing with a strange error:

Code: [Select]
{"id":1,"method":"call","params":[0,"get_block",[4658091]]}

{code:1,message:7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:530 get_array,data:{code:7,name:bad_cast_exception,message:Bad Cast,stack:[{context:{level:error,file:variant.cpp,line:53
0,method:get_array,hostname:,thread_name:th_a,timestamp:2016-04-09T20:28:59},format:Invalid cast from ${type} to Array,data:{type:object_type}}
]}}

If I call the function on the prior block it returns fine. Any ideas what could be causing this?
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads