@@ -22,29 +22,6 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
22
22
let old_state: ColdkeyHotkeys =
23
23
json:: from_slice ( & bytes) . map_err ( |e| format ! ( "Error parsing genesis file: {e}" ) ) ?;
24
24
25
- let mut processed_stakes: Vec < (
26
- sp_runtime:: AccountId32 ,
27
- Vec < ( sp_runtime:: AccountId32 , ( u64 , u16 ) ) > ,
28
- ) > = Vec :: new ( ) ;
29
- for ( coldkey_str, hotkeys) in old_state. stakes . iter ( ) {
30
- let coldkey = <sr25519:: Public as Ss58Codec >:: from_ss58check ( coldkey_str)
31
- . map_err ( |e| e. to_string ( ) ) ?;
32
- let coldkey_account = sp_runtime:: AccountId32 :: from ( coldkey) ;
33
-
34
- let mut processed_hotkeys: Vec < ( sp_runtime:: AccountId32 , ( u64 , u16 ) ) > = Vec :: new ( ) ;
35
-
36
- for ( hotkey_str, amount_uid) in hotkeys. iter ( ) {
37
- let ( amount, uid) = amount_uid;
38
- let hotkey = <sr25519:: Public as Ss58Codec >:: from_ss58check ( hotkey_str)
39
- . map_err ( |e| e. to_string ( ) ) ?;
40
- let hotkey_account = sp_runtime:: AccountId32 :: from ( hotkey) ;
41
-
42
- processed_hotkeys. push ( ( hotkey_account, ( * amount, * uid) ) ) ;
43
- }
44
-
45
- processed_stakes. push ( ( coldkey_account, processed_hotkeys) ) ;
46
- }
47
-
48
25
let mut balances_issuance: u64 = 0 ;
49
26
let mut processed_balances: Vec < ( sp_runtime:: AccountId32 , u64 ) > = Vec :: new ( ) ;
50
27
for ( key_str, amount) in old_state. balances . iter ( ) {
@@ -60,7 +37,7 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
60
37
61
38
// Give front-ends necessary data to present to users
62
39
let mut properties = sc_service:: Properties :: new ( ) ;
63
- properties. insert ( "tokenSymbol" . into ( ) , "TAO " . into ( ) ) ;
40
+ properties. insert ( "tokenSymbol" . into ( ) , "testTAO " . into ( ) ) ;
64
41
properties. insert ( "tokenDecimals" . into ( ) , 9 . into ( ) ) ;
65
42
properties. insert ( "ss58Format" . into ( ) , 42 . into ( ) ) ;
66
43
@@ -116,8 +93,8 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
116
93
// Pre-funded accounts
117
94
vec ! [ ] ,
118
95
true ,
119
- processed_stakes . clone ( ) ,
120
- processed_balances. clone ( ) ,
96
+ vec ! [ ] ,
97
+ processed_balances,
121
98
balances_issuance,
122
99
) )
123
100
. with_properties ( properties)
@@ -128,7 +105,7 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
128
105
#[ allow( clippy:: too_many_arguments) ]
129
106
fn testnet_genesis (
130
107
initial_authorities : Vec < ( AuraId , GrandpaId ) > ,
131
- _root_key : AccountId ,
108
+ root_key : AccountId ,
132
109
_endowed_accounts : Vec < AccountId > ,
133
110
_enable_println : bool ,
134
111
_stakes : Vec < ( AccountId , Vec < ( AccountId , ( u64 , u16 ) ) > ) > ,
@@ -138,11 +115,7 @@ fn testnet_genesis(
138
115
serde_json:: json!( {
139
116
"balances" : {
140
117
// Configure sudo balance
141
- "balances" : vec![ (
142
- <AccountId32 as Ss58Codec >:: from_ss58check( "5GpzQgpiAKHMWNSH3RN4GLf96GVTDct9QxYEFAY7LWcVzTbx" )
143
- . unwrap( ) ,
144
- 1000000000000u128 ,
145
- ) ] ,
118
+ "balances" : vec![ ( root_key. clone( ) , 1_000_000_000_000u128 ) ] ,
146
119
} ,
147
120
"aura" : {
148
121
"authorities" : initial_authorities. iter( ) . map( |x| ( x. 0 . clone( ) ) ) . collect:: <Vec <_>>( ) ,
@@ -154,10 +127,7 @@ fn testnet_genesis(
154
127
. collect:: <Vec <_>>( ) ,
155
128
} ,
156
129
"sudo" : {
157
- "key" : Some (
158
- <AccountId32 as Ss58Codec >:: from_ss58check( "5GpzQgpiAKHMWNSH3RN4GLf96GVTDct9QxYEFAY7LWcVzTbx" )
159
- . unwrap( ) ,
160
- ) ,
130
+ "key" : Some ( root_key) ,
161
131
} ,
162
132
} )
163
133
}
0 commit comments