Closed roadscape closed 8 years ago
Reproduce:
unlocked >>> set_voting_proxy abit-2fa in.abit true
set_voting_proxy abit-2fa in.abit true
1600759ms th_a wallet.cpp:1896 sign_transaction ] Caught exception while broadcasting tx 15915a9cc04ec88afbbda
c5c9c3f987744221cda: 0 exception: unspecified
7 bad_cast_exception: Bad Cast
Invalid cast from type 'array_type' to Object
{"type":"array_type"}
th_a variant.cpp:575 get_object
{"error":"7 bad_cast_exception: Bad Cast\nInvalid cast from type 'array_type' to Object\n {\"type\":\"array_type\"}\n th_a
variant.cpp:575 get_object","data":{"id":23,"error":{"code":1,"message":"7 bad_cast_exception: Bad Cast\nInvalid cast from type 'array
_type' to Object\n {\"type\":\"array_type\"}\n th_a variant.cpp:575 get_object","data":{"code":7,"name":"bad_cast_exception","m
essage":"Bad Cast","stack":[{"context":{"level":"error","file":"variant.cpp","line":575,"method":"get_object","hostname":"","thread_na
me":"th_a","timestamp":"2016-02-20T15:26:40"},"format":"Invalid cast from type '${type}' to Object","data":{"type":"array_type"}}]}}}}
th_a state.cpp:38 handle_reply
Related issue (old cli_wallet with new witness_node as well. There is a new account registered in this block):
locked >>> get_block 3710432
get_block 3710432
7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
{"type":"object_type"}
th_a variant.cpp:530 get_array
The "Related issue" in above comment is unable to fix / won't fix, since the best is to modify the cli_wallet code, but latest cli_wallet works fine so no need to modify.
The issue in OP can probably be fixed by adding an additional judgement "|| get_type() == array_type
" here, so arrays have chance to be tried to be converted to object. I will try.
Anyway, please be aware that it's dangerous to enable this new format of transaction before hard fork date, because it may probably cause network forking. please be aware that it's not dangerous to enable this new format before hard fork date if keep the extensions
field empty .
Another option would be change the extensions
field back to an array, so it will have better backwards compatibility. For example change the definition in this line from extension< ext > extensions
to vector<extension< ext >> extensions
and change related code accordingly.
Update: it's not dangerous to enable this new format before hard fork date if keep the extensions
field empty , according to @pmconrad's comment in this thread. So GUi can be updated safely.
We're aware of this issue and working on a fix
Fixed in latest release.
Users are reporting issues with creating accounts and updating votes, and it may be because "the extensions field on account create/update operations is now a struct not an array"
Source: https://bitsharestalk.org/index.php/topic,21530.msg280473.html#msg280473
User pc replies:
Another one of the manifestations of this issue is that you cannot change your votes from the GUI wallet. @svk31 wonders if the appropriate changes were made in cli_wallet.