Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset claim pool operation #572

Merged
merged 22 commits into from Feb 23, 2018
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8f24bca
Implemented the new operation asset_claim_pool_operation
Dec 18, 2017
6435e51
Add visitor to check pre-HF use of new operation
xeroc Jan 12, 2018
b09d338
Remove whitespaces
xeroc Jan 17, 2018
7e78949
Change hardfork name
xeroc Jan 18, 2018
a473a9e
Hard fork times updated in fee tests
xeroc Jan 18, 2018
e6506d2
fixes errors and added fee_helper for asset_claim_pool_operation
xeroc Jan 22, 2018
83ff729
Fixes tests, typos and wront operations
xeroc Jan 23, 2018
a9ef41c
fix typo in hardfork comment
xeroc Jan 24, 2018
80d2a2e
improved unittests and fixed hardfork conditions
xeroc Jan 26, 2018
9a424ce
fix assert message
xeroc Feb 9, 2018
dba7a53
fix terminology in documentation
xeroc Feb 9, 2018
c260938
Also test the hf_xxx_visitor thru a proposal
xeroc Feb 9, 2018
ba54247
Test claim pool with proposal after hard fork #188
abitmore Feb 13, 2018
119dc91
[tests] properly reload objects after new blocks have been generated
xeroc Feb 13, 2018
c767e0c
[tests] properly reload objects after new blocks have been generated …
xeroc Feb 13, 2018
563ed57
Add missing semicolon
xeroc Feb 14, 2018
8e41fab
[tests] Fix unsafe variables in unit test
xeroc Feb 14, 2018
53b2404
[test] Make sure to have a safe reference to core_asset after block g…
xeroc Feb 14, 2018
294f918
increase hardfork time during development
xeroc Feb 22, 2018
716638d
Do not capture all in lambda
xeroc Feb 22, 2018
a8c1584
Fix terminology of variables in cli_wallet
xeroc Feb 22, 2018
77dfdf8
Do not use reference on *_id_type
xeroc Feb 22, 2018
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

[tests] properly reload objects after new blocks have been generated

  • Loading branch information...
xeroc committed Feb 13, 2018
commit 119dc915c90bae16b7395bd86bc5b82e3a437d18
@@ -286,7 +286,7 @@ BOOST_AUTO_TEST_CASE(asset_claim_pool_test)
const asset_object& core_asset = asset_id_type()(db);

// deposit 100 BTS to the fee pool of ALICEUSD asset
fund_fee_pool( alice, aliceusd, _core(100).amount );
fund_fee_pool( alice_id(db), aliceusd, _core(100).amount );

// Unable to claim pool before the hardfork
GRAPHENE_REQUIRE_THROW( claim_pool( alice_id, aliceusd.id, _core(1), core_asset), fc::exception );
@@ -299,11 +299,11 @@ BOOST_AUTO_TEST_CASE(asset_claim_pool_test)
GRAPHENE_REQUIRE_THROW( claim_pool( alice_id, alicecoin.id, _core(1), core_asset), fc::exception );

// deposit 300 BTS to the fee pool of ALICECOIN asset
fund_fee_pool( alice, alicecoin, _core(300).amount );
fund_fee_pool( alice_id(db), alicecoin, _core(300).amount );

This comment has been minimized.

Copy link
@abitmore

abitmore Feb 13, 2018

Member

Need to change references to alicecoin and aliceusd as well.


// Test amount of CORE in fee pools
BOOST_CHECK( alicecoin.dynamic_asset_data_id(db).fee_pool == _core(300).amount );
BOOST_CHECK( aliceusd.dynamic_asset_data_id(db).fee_pool == _core(100).amount );
BOOST_CHECK( alicecoin.dynamic_asset_data_id(db).fee_pool.value == _core(300).amount );

This comment has been minimized.

Copy link
@abitmore

abitmore Feb 13, 2018

Member

No. I mean using BOOST_CHECK_EQUAL is better than BOOST_CHECK( a == b ) when possible. Actually my previous comment is not 100% correct because I overlooked core_prec.

This comment has been minimized.

Copy link
@abitmore

abitmore Feb 13, 2018

Member

BOOST_CHECK_EQUAL( alicecoin.dynamic_asset_data_id(db).fee_pool.value, 300*core_prec) would work.

This comment has been minimized.

Copy link
@abitmore

abitmore Feb 13, 2018

Member

This "would work" change looks ugly. I don't know why it times precision in the first place which makes the tests a bit complicated. Not a big deal anyway, so I think it's fine to revert this change. Thanks.

BOOST_CHECK( aliceusd.dynamic_asset_data_id(db).fee_pool.value == _core(100).amount );

This comment has been minimized.

Copy link
@abitmore

abitmore Jan 20, 2018

Member

Need unit test code that trigger and catch the exception before hard fork time.

This comment has been minimized.

Copy link
@xeroc

xeroc Jan 22, 2018

Author Member

I dublicated hardfork related code from another test and modified it accordingly. Does this qualify as a proper test?

// can't claim pool of an asset that doesn't belong to you
GRAPHENE_REQUIRE_THROW( claim_pool( alice_id, bobcoin_id, _core(200), core_asset), fc::exception );
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.