@@ -19,14 +19,14 @@ use starcoin_executor::execute_readonly_function;
19
19
use starcoin_logger:: prelude:: * ;
20
20
use starcoin_state_api:: ChainStateReader ;
21
21
use starcoin_statedb:: ChainStateDB ;
22
- use starcoin_transaction_builder:: encode_create_account_script_function ;
22
+ use starcoin_transaction_builder:: encode_transfer_script_by_token_code ;
23
23
use starcoin_types:: account_address:: AccountAddress ;
24
24
use starcoin_types:: account_config:: { association_address, genesis_address, stc_type_tag} ;
25
25
use starcoin_types:: block_metadata:: BlockMetadata ;
26
26
use starcoin_types:: identifier:: Identifier ;
27
27
use starcoin_types:: language_storage:: { ModuleId , StructTag , TypeTag } ;
28
28
use starcoin_types:: transaction:: { EntryFunction , TransactionPayload } ;
29
- use starcoin_vm_types:: account_config:: core_code_address;
29
+ use starcoin_vm_types:: account_config:: { core_code_address, G_STC_TOKEN_CODE } ;
30
30
use starcoin_vm_types:: on_chain_config:: VMConfig ;
31
31
use starcoin_vm_types:: value:: { serialize_values, MoveValue } ;
32
32
use starcoin_vm_types:: StateView ;
@@ -50,7 +50,7 @@ pub fn proposal_state<S: StateView>(
50
50
) -> u8 {
51
51
let mut ret = execute_readonly_function (
52
52
state_view,
53
- & ModuleId :: new ( genesis_address ( ) , Identifier :: new ( "Dao " ) . unwrap ( ) ) ,
53
+ & ModuleId :: new ( genesis_address ( ) , Identifier :: new ( "dao " ) . unwrap ( ) ) ,
54
54
& Identifier :: new ( "proposal_state" ) . unwrap ( ) ,
55
55
vec ! [ token, action_ty. clone( ) ] ,
56
56
serialize_values ( & vec ! [
@@ -78,7 +78,7 @@ pub fn proposal_exist<S: StateView>(
78
78
) -> bool {
79
79
let mut ret = execute_readonly_function (
80
80
state_view,
81
- & ModuleId :: new ( genesis_address ( ) , Identifier :: new ( "Dao " ) . unwrap ( ) ) ,
81
+ & ModuleId :: new ( genesis_address ( ) , Identifier :: new ( "dao " ) . unwrap ( ) ) ,
82
82
& Identifier :: new ( "proposal_exists" ) . unwrap ( ) ,
83
83
vec ! [ token, action_ty] ,
84
84
serialize_values ( & vec ! [
@@ -95,7 +95,7 @@ pub fn proposal_exist<S: StateView>(
95
95
pub fn on_chain_config_type_tag ( params_type_tag : TypeTag ) -> TypeTag {
96
96
TypeTag :: Struct ( Box :: new ( StructTag {
97
97
address : genesis_address ( ) ,
98
- module : Identifier :: new ( "OnChainConfigDao " ) . unwrap ( ) ,
98
+ module : Identifier :: new ( "on_chain_config_dao " ) . unwrap ( ) ,
99
99
name : Identifier :: new ( "OnChainConfigUpdate" ) . unwrap ( ) ,
100
100
type_args : vec ! [ params_type_tag] ,
101
101
} ) )
@@ -104,7 +104,7 @@ pub fn on_chain_config_type_tag(params_type_tag: TypeTag) -> TypeTag {
104
104
pub fn reward_config_type_tag ( ) -> TypeTag {
105
105
TypeTag :: Struct ( Box :: new ( StructTag {
106
106
address : genesis_address ( ) ,
107
- module : Identifier :: new ( "RewardConfig " ) . unwrap ( ) ,
107
+ module : Identifier :: new ( "block_reward_config " ) . unwrap ( ) ,
108
108
name : Identifier :: new ( "RewardConfig" ) . unwrap ( ) ,
109
109
type_args : vec ! [ ] ,
110
110
} ) )
@@ -113,7 +113,7 @@ pub fn reward_config_type_tag() -> TypeTag {
113
113
pub fn transaction_timeout_type_tag ( ) -> TypeTag {
114
114
TypeTag :: Struct ( Box :: new ( StructTag {
115
115
address : genesis_address ( ) ,
116
- module : Identifier :: new ( "TransactionTimeoutConfig " ) . unwrap ( ) ,
116
+ module : Identifier :: new ( "stc_transaction_timeout_config " ) . unwrap ( ) ,
117
117
name : Identifier :: new ( "TransactionTimeoutConfig" ) . unwrap ( ) ,
118
118
type_args : vec ! [ ] ,
119
119
} ) )
@@ -122,7 +122,7 @@ pub fn transaction_timeout_type_tag() -> TypeTag {
122
122
pub fn txn_publish_config_type_tag ( ) -> TypeTag {
123
123
TypeTag :: Struct ( Box :: new ( StructTag {
124
124
address : genesis_address ( ) ,
125
- module : Identifier :: new ( "TransactionPublishOption " ) . unwrap ( ) ,
125
+ module : Identifier :: new ( "transaction_publish_option " ) . unwrap ( ) ,
126
126
name : Identifier :: new ( "TransactionPublishOption" ) . unwrap ( ) ,
127
127
type_args : vec ! [ ] ,
128
128
} ) )
@@ -151,23 +151,18 @@ pub fn execute_create_account(
151
151
) ?;
152
152
if !chain_state. exist_account ( alice. address ( ) ) ? {
153
153
let init_balance = pre_mint_amount / 4 ;
154
- let script_function = encode_create_account_script_function (
155
- net. stdlib_version ( ) ,
156
- stc_type_tag ( ) ,
157
- alice. address ( ) ,
158
- alice. auth_key ( ) ,
154
+ let script_function = encode_transfer_script_by_token_code (
155
+ * alice. address ( ) ,
159
156
init_balance,
157
+ G_STC_TOKEN_CODE . clone ( ) ,
160
158
) ;
159
+
161
160
debug ! (
162
161
"execute create account script: addr:{}, init_balance:{}" ,
163
162
alice. address( ) ,
164
163
init_balance
165
164
) ;
166
- association_execute_should_success (
167
- net,
168
- chain_state,
169
- TransactionPayload :: EntryFunction ( script_function) ,
170
- ) ?;
165
+ association_execute_should_success ( net, chain_state, script_function) ?;
171
166
}
172
167
173
168
Ok ( ( ) )
0 commit comments