diff --git a/vm/framework/starcoin-framework/doc/stc_genesis.md b/vm/framework/starcoin-framework/doc/stc_genesis.md index b3f87021fe..84c6362784 100644 --- a/vm/framework/starcoin-framework/doc/stc_genesis.md +++ b/vm/framework/starcoin-framework/doc/stc_genesis.md @@ -10,6 +10,7 @@ The module for init Genesis - [Function `initialize_versions`](#0x1_stc_genesis_initialize_versions) - [Function `initialize_stc`](#0x1_stc_genesis_initialize_stc) - [Function `initialize_stc_governance_allocation`](#0x1_stc_genesis_initialize_stc_governance_allocation) +- [Function `initialize_for_unit_tests`](#0x1_stc_genesis_initialize_for_unit_tests) - [Specification](#@Specification_0) @@ -406,6 +407,105 @@ Overall governance allocation strategy: + + + + +## Function `initialize_for_unit_tests` + + + +
public fun initialize_for_unit_tests()
+
+
+
+
+public fun initialize_for_unit_tests() {
+ let stdlib_version: u64 = 6;
+ let reward_delay: u64 = 7;
+ let total_stc_amount: u128 = 3185136000000000000u128;
+ let pre_mine_stc_amount: u128 = 159256800000000000u128;
+ let time_mint_stc_amount: u128 = (85043130u128 * 3u128 + 74213670u128 * 3u128) * 1000000000u128;
+ let time_mint_stc_period: u64 = 1000000000;
+
+ let parent_hash: vector<u8> = x"0000000000000000000000000000000000000000000000000000000000000000";
+ let association_auth_key: vector<u8> = x"0000000000000000000000000000000000000000000000000000000000000000";
+ let genesis_auth_key: vector<u8> = x"0000000000000000000000000000000000000000000000000000000000000000";
+ let chain_id: u8 = 255;
+ let genesis_timestamp: u64 = 0;
+
+ //consensus config
+ let uncle_rate_target: u64 = 80;
+ let epoch_block_count: u64 = 240;
+ let base_block_time_target: u64 = 10000;
+ let base_block_difficulty_window: u64 = 24;
+ let base_reward_per_block: u128 = 1000000000;
+ let base_reward_per_uncle_percent: u64 = 10;
+ let min_block_time_target: u64 = 1000;
+ let max_block_time_target: u64 = 20000;
+ let base_max_uncles_per_block: u64 = 2;
+ let base_block_gas_limit: u64 = 500000000;
+ let strategy: u8 = 0;
+
+ //vm config
+ let script_allowed: bool = true;
+ let module_publishing_allowed: bool = true;
+
+ // todo: initialize gas_schedule_blob properly
+ let gas_schedule_blob: vector<u8> = vector::empty<u8>();
+
+ // dao config
+ let voting_delay: u64 = 1000;
+ let voting_period: u64 = 6000;
+ let voting_quorum_rate: u8 = 4;
+ let min_action_delay: u64 = 1000;
+
+ // transaction timeout config
+ let transaction_timeout: u64 = 10000;
+
+ Self::initialize(
+ stdlib_version,
+ reward_delay,
+ total_stc_amount,
+ pre_mine_stc_amount,
+ time_mint_stc_amount,
+ time_mint_stc_period,
+ parent_hash,
+ association_auth_key,
+ genesis_auth_key,
+ chain_id,
+ genesis_timestamp,
+ uncle_rate_target,
+ epoch_block_count,
+ base_block_time_target,
+ base_block_difficulty_window,
+ base_reward_per_block,
+ base_reward_per_uncle_percent,
+ min_block_time_target,
+ max_block_time_target,
+ base_max_uncles_per_block,
+ base_block_gas_limit,
+ strategy,
+ script_allowed,
+ module_publishing_allowed,
+ gas_schedule_blob,
+ voting_delay,
+ voting_period,
+ voting_quorum_rate,
+ min_action_delay,
+ transaction_timeout,
+ 0,
+ vector::empty(),
+ );
+}
+
+
+
+