Skip to content

Commit

Permalink
Issue #722 - condenser_api should return the actual operation body
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz-Trela committed Oct 1, 2024
1 parent 1570622 commit 306dbd6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libraries/protocol/include/hive/protocol/block_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct variant_creator_functor< block_header_extensions >
template<typename T>
fc::variant operator()( const T& v ) const
{
return extended_variant_creator_functor< block_header_extensions >().create( v );
return extended_variant_creator_functor< block_header_extensions >().create( v, block_header_extensions::tag<T>::value );
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace fc
template<typename T>
fc::variant operator()( const T& v ) const
{
return extended_variant_creator_functor< update_proposal_extension >().create( v );
return extended_variant_creator_functor< update_proposal_extension >().create( v, update_proposal_extension::tag<T>::value );
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ namespace fc
template<typename T>
fc::variant operator()( const T& v ) const
{
return extended_variant_creator_functor< pow2_work >().create( v );
return extended_variant_creator_functor< pow2_work >().create( v, pow2_work::tag<T>::value );
}
};

Expand Down
2 changes: 1 addition & 1 deletion tests/python/functional/cli_wallet/test_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def check_is_proposal_update_exists(block_number: int, end_date: date_type) -> b

op = response[0]["op"]
extensions = op[1]["extensions"][0]
return extensions[0] == "update_proposal_end_date" and extensions[1]["end_date"] == end_date
return extensions[0] == 1 and extensions[1]["end_date"] == end_date

author = funded_account.account
current_daily_pay = tt.Asset.Tbd(10)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ref_block_num":30,"ref_block_prefix":1561542156,"expiration":"2023-01-02T11:26:57","operations":[["update_proposal",{"proposal_id":0,"creator":"alice","daily_pay":"10.000 TBD","subject":"subject-1","permlink":"permlink","extensions":[["update_proposal_end_date",{"end_date":"2031-05-01T00:00:00"}]]}]],"extensions":[],"signatures":["1f0c8207d3f28e70c33af1f5f7be1c18a10c14692030d732ca12d39a402eb5bd2c6d4d3b91806e6d349dd1e310eec6a55a99b92e76989f1c972a9834b97e9c5682"]}
{"ref_block_num":30,"ref_block_prefix":1561542156,"expiration":"2023-01-02T11:26:57","operations":[["update_proposal",{"proposal_id":0,"creator":"alice","daily_pay":"10.000 TBD","subject":"subject-1","permlink":"permlink","extensions":[[1,{"end_date":"2031-05-01T00:00:00"}]]}]],"extensions":[],"signatures":["1f0c8207d3f28e70c33af1f5f7be1c18a10c14692030d732ca12d39a402eb5bd2c6d4d3b91806e6d349dd1e310eec6a55a99b92e76989f1c972a9834b97e9c5682"]}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_change_comment_operation(node, api, expected_extension):
("api", "expected_extension"),
[
("block", {"type": "update_proposal_end_date", "value": {"end_date": PROPOSAL_END_DATE_AFTER_UPDATE}}),
("condenser", ["update_proposal_end_date", {"end_date": PROPOSAL_END_DATE_AFTER_UPDATE}]),
("condenser", [1, {"end_date": PROPOSAL_END_DATE_AFTER_UPDATE}]),
],
)
@run_for("testnet")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ BOOST_AUTO_TEST_CASE( get_account_history_hf13 )
R"~([1,{"trx_id":"47fae6df13c7117800ec407bafb1afc62f918cd3","block":3,"trx_in_block":0,"op_in_trx":1,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":["account_created",{"new_account_name":"dan0ah","creator":"dan0ah","initial_vesting_shares":"0.000000 VESTS","initial_delegation":"0.000000 VESTS"}]}])~"
#else
R"~([0,{"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":{"type":"pow2_operation","value":{"work":{"type":"pow2","value":{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}},"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":{"amount":"0","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"hbd_interest_rate":1000}}},"operation_id":0}])~",
R"~([0,{"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":["pow2",{"work":["pow2",{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}],"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":"0.000 TESTS","maximum_block_size":131072,"hbd_interest_rate":1000}}]}])~"
R"~([0,{"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":["pow2",{"work":[0,{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}],"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":"0.000 TESTS","maximum_block_size":131072,"hbd_interest_rate":1000}}]}])~"
}, {
R"~([1,{"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":1,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":{"type":"account_created_operation","value":{"new_account_name":"dan0ah","creator":"dan0ah","initial_vesting_shares":{"amount":"0","precision":6,"nai":"@@000000037"},"initial_delegation":{"amount":"0","precision":6,"nai":"@@000000037"}}},"operation_id":0}])~",
R"~([1,{"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":1,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":["account_created",{"new_account_name":"dan0ah","creator":"dan0ah","initial_vesting_shares":"0.000000 VESTS","initial_delegation":"0.000000 VESTS"}]}])~"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ BOOST_AUTO_TEST_CASE( get_ops_in_block_hf13 )
R"~({"trx_id":"47fae6df13c7117800ec407bafb1afc62f918cd3","block":3,"trx_in_block":0,"op_in_trx":2,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":["pow_reward",{"worker":"initminer","reward":"1000000.000000 VESTS"}]})~"
#else
R"~({"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":{"type":"pow2_operation","value":{"work":{"type":"pow2","value":{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}},"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":{"amount":"0","precision":3,"nai":"@@000000021"},"maximum_block_size":131072,"hbd_interest_rate":1000}}},"operation_id":0})~",
R"~({"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":["pow2",{"work":["pow2",{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}],"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":"0.000 TESTS","maximum_block_size":131072,"hbd_interest_rate":1000}}]})~"
R"~({"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":0,"virtual_op":false,"timestamp":"2016-01-01T00:00:09","op":["pow2",{"work":[0,{"input":{"worker_account":"dan0ah","prev_block":"00000002a8c7664246009c0f84f09687dfb9ec55","nonce":8},"pow_summary":4211230234}],"new_owner_key":"STM7YJmUoKbPQkrMrZbrgPxDMYJA3uD3utaN3WYRwaFGKYbQ9ftKV","props":{"account_creation_fee":"0.000 TESTS","maximum_block_size":131072,"hbd_interest_rate":1000}}]})~"
}, { // account_created_operation
R"~({"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":1,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":{"type":"account_created_operation","value":{"new_account_name":"dan0ah","creator":"dan0ah","initial_vesting_shares":{"amount":"0","precision":6,"nai":"@@000000037"},"initial_delegation":{"amount":"0","precision":6,"nai":"@@000000037"}}},"operation_id":0})~",
R"~({"trx_id":"ff3ec48842cf338b6a5905e817daea3cd12b0dd4","block":3,"trx_in_block":0,"op_in_trx":1,"virtual_op":true,"timestamp":"2016-01-01T00:00:09","op":["account_created",{"new_account_name":"dan0ah","creator":"dan0ah","initial_vesting_shares":"0.000000 VESTS","initial_delegation":"0.000000 VESTS"}]})~"
Expand Down

0 comments on commit 306dbd6

Please sign in to comment.