@@ -5,7 +5,7 @@ use ckb_system_scripts_v0_5_4::{
55 CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL as CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_LEGACY ,
66 CODE_HASH_SECP256K1_DATA ,
77} ;
8- use ckb_system_scripts_v0_6_0:: CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL as CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V1 ;
8+ use ckb_system_scripts_v0_6_0:: CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL as CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V2 ;
99use ckb_types:: {
1010 core:: EpochNumberWithFraction ,
1111 h256,
@@ -78,7 +78,7 @@ pub enum MultisigScript {
7878
7979 /// Latest multisig script
8080 /// https://explorer.nervos.org/script/0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29/data1
81- V1 ,
81+ V2 ,
8282}
8383
8484impl MultisigScript {
@@ -87,7 +87,7 @@ impl MultisigScript {
8787 MultisigScript :: Legacy => ScriptId :: new_type ( h256 ! (
8888 "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8"
8989 ) ) ,
90- MultisigScript :: V1 => ScriptId :: new_data1 ( h256 ! (
90+ MultisigScript :: V2 => ScriptId :: new_data1 ( h256 ! (
9191 "0x36c971b8d41fbd94aabca77dc75e826729ac98447b46f91e00796155dddb0d29"
9292 ) ) ,
9393 }
@@ -96,7 +96,7 @@ impl MultisigScript {
9696 fn dep_group_from_env ( & self , _network : NetworkInfo ) -> Option < ( H256 , u32 ) > {
9797 let env_dep_group = match self {
9898 MultisigScript :: Legacy => std:: env:: var ( "MULTISIG_LEGACY_DEP_GROUP" ) ,
99- MultisigScript :: V1 => std:: env:: var ( "MULTISIG_V1_DEP_GROUP " ) ,
99+ MultisigScript :: V2 => std:: env:: var ( "MULTISIG_V2_DEP_GROUP " ) ,
100100 }
101101 . ok ( ) ?;
102102
@@ -119,7 +119,7 @@ impl MultisigScript {
119119
120120 /// Get dep group from env first:
121121 /// 1. MULTISIG_LEGACY_DEP_GROUP=0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c,1
122- /// 2. MULTISIG_V1_DEP_GROUP =0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738,2
122+ /// 2. MULTISIG_V2_DEP_GROUP =0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738,2
123123 ///
124124 /// If env not set, then get it from dep_group_inner
125125 pub fn dep_group ( & self , network : NetworkInfo ) -> Option < ( H256 , u32 ) > {
@@ -134,7 +134,7 @@ impl MultisigScript {
134134 h256 ! ( "0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c" ) ,
135135 1 ,
136136 ) ,
137- MultisigScript :: V1 => (
137+ MultisigScript :: V2 => (
138138 h256 ! ( "0x6888aa39ab30c570c2c30d9d5684d3769bf77265a7973211a3c087fe8efbf738" ) ,
139139 0 ,
140140 ) ,
@@ -144,7 +144,7 @@ impl MultisigScript {
144144 h256 ! ( "0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37" ) ,
145145 1 ,
146146 ) ,
147- MultisigScript :: V1 => (
147+ MultisigScript :: V2 => (
148148 h256 ! ( "0x2eefdeb21f3a3edf697c28a52601b4419806ed60bb427420455cc29a090b26d5" ) ,
149149 0 ,
150150 ) ,
@@ -161,7 +161,7 @@ impl MultisigScript {
161161 MultisigScript :: Legacy => {
162162 CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_LEGACY . pack ( )
163163 }
164- MultisigScript :: V1 => CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V1 . pack ( ) ,
164+ MultisigScript :: V2 => CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V2 . pack ( ) ,
165165 } ;
166166 let multisig_outpoint =
167167 find_cell_match_data_hash ( & genesis_block, target_data_hash) ?;
@@ -232,8 +232,8 @@ impl TryFrom<H256> for MultisigScript {
232232 fn try_from ( code_hash : H256 ) -> Result < Self , Self :: Error > {
233233 if code_hash. eq ( & MultisigScript :: Legacy . script_id ( ) . code_hash ) {
234234 Ok ( MultisigScript :: Legacy )
235- } else if code_hash. eq ( & MultisigScript :: V1 . script_id ( ) . code_hash ) {
236- Ok ( MultisigScript :: V1 )
235+ } else if code_hash. eq ( & MultisigScript :: V2 . script_id ( ) . code_hash ) {
236+ Ok ( MultisigScript :: V2 )
237237 } else {
238238 Err ( ( ) )
239239 }
@@ -269,16 +269,16 @@ mod test {
269269 fn test_multisig_deps ( ) {
270270 assert_ne ! (
271271 CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_LEGACY ,
272- CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V1
272+ CODE_HASH_SECP256K1_BLAKE160_MULTISIG_ALL_V2
273273 ) ;
274274
275275 let mainnet = NetworkInfo :: mainnet ( ) ;
276276 assert ! ( MultisigScript :: Legacy . dep_group( mainnet. clone( ) ) . is_some( ) ) ;
277- assert ! ( MultisigScript :: V1 . dep_group( mainnet) . is_some( ) ) ;
277+ assert ! ( MultisigScript :: V2 . dep_group( mainnet) . is_some( ) ) ;
278278
279279 let testnet = NetworkInfo :: testnet ( ) ;
280280 assert ! ( MultisigScript :: Legacy . dep_group( testnet. clone( ) ) . is_some( ) ) ;
281- assert ! ( MultisigScript :: V1 . dep_group( testnet) . is_some( ) ) ;
281+ assert ! ( MultisigScript :: V2 . dep_group( testnet) . is_some( ) ) ;
282282
283283 // TODO: start ckb devchain in this unit test
284284 // let devnet = NetworkInfo::devnet();
0 commit comments