Skip to content

Commit 11aa1be

Browse files
committed
BSIP74: Tests
1 parent d1b5624 commit 11aa1be

File tree

3 files changed

+2284
-5
lines changed

3 files changed

+2284
-5
lines changed

tests/common/database_fixture.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ asset_create_operation database_fixture::make_bitasset(
706706
uint16_t precision /* = GRAPHENE_BLOCKCHAIN_PRECISION_DIGITS */,
707707
asset_id_type backing_asset /* = CORE */,
708708
share_type max_supply, /* = GRAPHENE_MAX_SHARE_SUPPLY */
709-
optional<uint16_t> initial_cr /* = {} */
709+
optional<uint16_t> initial_cr, /* = {} */
710+
optional<uint16_t> margin_call_fee_ratio /* = {} */
710711
)
711712
{
712713
asset_create_operation creator;
@@ -724,6 +725,7 @@ asset_create_operation database_fixture::make_bitasset(
724725
creator.bitasset_opts = bitasset_options();
725726
creator.bitasset_opts->short_backing_asset = backing_asset;
726727
creator.bitasset_opts->extensions.value.initial_collateral_ratio = initial_cr;
728+
creator.bitasset_opts->extensions.value.margin_call_fee_ratio = margin_call_fee_ratio;
727729
return creator;
728730
}
729731

@@ -735,11 +737,13 @@ const asset_object& database_fixture::create_bitasset(
735737
uint16_t precision /* = GRAPHENE_BLOCKCHAIN_PRECISION_DIGITS */,
736738
asset_id_type backing_asset /* = CORE */,
737739
share_type max_supply, /* = GRAPHENE_MAX_SHARE_SUPPLY */
738-
optional<uint16_t> initial_cr /* = {} */
740+
optional<uint16_t> initial_cr, /* = {} */
741+
optional<uint16_t> margin_call_fee_ratio /* = {} */
739742
)
740743
{ try {
741744
asset_create_operation creator = make_bitasset( name, issuer, market_fee_percent, flags,
742-
precision, backing_asset, max_supply, initial_cr );
745+
precision, backing_asset, max_supply, initial_cr,
746+
margin_call_fee_ratio );
743747
trx.operations.clear();
744748
trx.operations.push_back(std::move(creator));
745749
trx.validate();

tests/common/database_fixture.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,17 @@ struct database_fixture {
290290
uint16_t precision = 2,
291291
asset_id_type backing_asset = {},
292292
share_type max_supply = GRAPHENE_MAX_SHARE_SUPPLY,
293-
optional<uint16_t> initial_cr = {} );
293+
optional<uint16_t> initial_cr = {},
294+
optional<uint16_t> margin_call_fee_ratio = {} );
294295
const asset_object& create_bitasset(const string& name,
295296
account_id_type issuer = GRAPHENE_WITNESS_ACCOUNT,
296297
uint16_t market_fee_percent = 100 /*1%*/,
297298
uint16_t flags = charge_market_fee,
298299
uint16_t precision = 2,
299300
asset_id_type backing_asset = {},
300301
share_type max_supply = GRAPHENE_MAX_SHARE_SUPPLY,
301-
optional<uint16_t> initial_cr = {} );
302+
optional<uint16_t> initial_cr = {},
303+
optional<uint16_t> margin_call_fee_ratio = {} );
302304
const asset_object& create_prediction_market(const string& name,
303305
account_id_type issuer = GRAPHENE_WITNESS_ACCOUNT,
304306
uint16_t market_fee_percent = 100 /*1%*/,

0 commit comments

Comments
 (0)