Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit cd97982

Browse files
authored
Merge pull request #3210 from EOSIO/gh#2099-get-block
get block display of old structs
2 parents 817cd9d + afa002b commit cd97982

File tree

3 files changed

+64
-10
lines changed

3 files changed

+64
-10
lines changed

contracts/eosio.system/eosio.system.abi

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"new_type_name": "weight_type",
1717
"type": "uint16"
1818
}],
19+
"____comment": "eosio.bios structs: set_account_limits, setpriv, set_global_limits, producer_key, set_producers, require_auth are provided so abi available for deserialization in future.",
1920
"structs": [{
2021
"name": "permission_level",
2122
"base": "",
@@ -333,6 +334,40 @@
333334
{"name":"account", "type":"account_name"},
334335
{"name":"is_priv", "type":"int8"}
335336
]
337+
},{
338+
"name": "set_account_limits",
339+
"base": "",
340+
"fields": [
341+
{"name":"account", "type":"account_name"},
342+
{"name":"ram_bytes", "type":"int64"},
343+
{"name":"net_weight", "type":"int64"},
344+
{"name":"cpu_weight", "type":"int64"}
345+
]
346+
},{
347+
"name": "set_global_limits",
348+
"base": "",
349+
"fields": [
350+
{"name":"cpu_usec_per_period", "type":"int64"}
351+
]
352+
},{
353+
"name": "producer_key",
354+
"base": "",
355+
"fields": [
356+
{"name":"producer_name", "type":"account_name"},
357+
{"name":"block_signing_key", "type":"public_key"}
358+
]
359+
},{
360+
"name": "set_producers",
361+
"base": "",
362+
"fields": [
363+
{"name":"schedule", "type":"producer_key[]"}
364+
]
365+
},{
366+
"name": "require_auth",
367+
"base": "",
368+
"fields": [
369+
{"name":"from", "type":"account_name"}
370+
]
336371
}
337372
],
338373
"actions": [{
@@ -423,7 +458,23 @@
423458
"name": "setpriv",
424459
"type": "setpriv",
425460
"ricardian_contract": ""
426-
}],
461+
},{
462+
"name": "setalimits",
463+
"type": "set_account_limits",
464+
"ricardian_contract": ""
465+
},{
466+
"name": "setglimits",
467+
"type": "set_global_limits",
468+
"ricardian_contract": ""
469+
},{
470+
"name": "setprods",
471+
"type": "set_producers",
472+
"ricardian_contract": ""
473+
},{
474+
"name": "reqauth",
475+
"type": "require_auth",
476+
"ricardian_contract": ""
477+
}],
427478
"tables": [{
428479
"name": "producers",
429480
"type": "producer_info",

libraries/chain/include/eosio/chain/abi_serializer.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ namespace impl {
233233
auto abi = resolver(act.account);
234234
if (abi.valid()) {
235235
auto type = abi->get_action_type(act.name);
236-
mvo("data", abi->binary_to_variant(type, act.data));
237-
mvo("hex_data", act.data);
236+
if (!type.empty()) {
237+
mvo("data", abi->binary_to_variant(type, act.data));
238+
mvo("hex_data", act.data);
239+
} else {
240+
mvo("data", act.data);
241+
}
238242
} else {
239243
mvo("data", act.data);
240244
}
@@ -394,7 +398,9 @@ namespace impl {
394398
auto abi = resolver(act.account);
395399
if (abi.valid()) {
396400
auto type = abi->get_action_type(act.name);
397-
act.data = std::move(abi->variant_to_binary(type, data));
401+
if (!type.empty()) {
402+
act.data = std::move( abi->variant_to_binary( type, data ));
403+
}
398404
}
399405
}
400406
}

tests/nodeos_run_test.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,10 @@ def cmdError(name, cmdCode=0, exitNow=False):
638638
Print("CurrentBlockNum: %d" % (currentBlockNum))
639639
Print("Request blocks 1-%d" % (currentBlockNum))
640640
for blockNum in range(1, currentBlockNum+1):
641-
block=node.getBlock(str(blockNum), retry=False, silentErrors=True)
641+
block=node.getBlock(str(blockNum), retry=False, silentErrors=False)
642642
if block is None:
643-
# TBD: Known issue (Issue 2099) that the block containing setprods isn't retrievable.
644-
# Enable errorExit() once that is resolved.
645-
Print("WARNING: Failed to get block %d (probably issue 2099). Report and keep going..." % (blockNum))
646-
# cmdError("%s get block" % (ClientName))
647-
# errorExit("get block by num %d" % blockNum)
643+
cmdError("%s get block" % (ClientName))
644+
errorExit("get block by num %d" % blockNum)
648645

649646
if enableMongo:
650647
blockId=block["block_id"]

0 commit comments

Comments
 (0)