|
15 | 15 |
|
16 | 16 | use chainstate_test_framework::empty_witness;
|
17 | 17 | use chainstate_test_framework::{TestFramework, TransactionBuilder};
|
18 |
| -use common::chain::tokens::{make_token_id, TokenId, TokenIssuance}; |
| 18 | +use common::chain::tokens::{make_token_id, TokenId, TokenIssuance, TokenTotalSupply}; |
19 | 19 | use common::chain::{AccountCommand, AccountNonce, TxInput};
|
20 | 20 | use common::primitives::BlockHeight;
|
21 | 21 | use common::{
|
@@ -162,6 +162,12 @@ pub fn issue_and_mint_tokens_from_genesis(
|
162 | 162 | Destination::AnyoneCanSpend,
|
163 | 163 | rng,
|
164 | 164 | );
|
| 165 | + let amount_to_mint = match issuance.total_supply { |
| 166 | + TokenTotalSupply::Fixed(limit) => Amount::from_atoms(rng.gen_range(1..=limit.into_atoms())), |
| 167 | + TokenTotalSupply::Lockable | TokenTotalSupply::Unlimited => { |
| 168 | + Amount::from_atoms(rng.gen_range(100..1000)) |
| 169 | + } |
| 170 | + }; |
165 | 171 |
|
166 | 172 | let genesis_outpoint = UtxoOutPoint::new(tf.best_block_id().into(), 0);
|
167 | 173 | let genesis_coins = chainstate_test_framework::get_output_value(
|
@@ -193,7 +199,6 @@ pub fn issue_and_mint_tokens_from_genesis(
|
193 | 199 | let token_supply_change_fee =
|
194 | 200 | tf.chainstate.get_chain_config().token_supply_change_fee(BlockHeight::zero());
|
195 | 201 | let coins_after_mint = (coins_after_issue - token_supply_change_fee).unwrap();
|
196 |
| - let amount_to_mint = Amount::from_atoms(1000); |
197 | 202 |
|
198 | 203 | let tx2 = TransactionBuilder::new()
|
199 | 204 | .add_input(
|
|
0 commit comments