|
31 | 31 | "should throw an error when its a full version address but hash_type is missing while code hash is not secp256k1 code hash": {
|
32 | 32 | "params": ["0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64", "0x00", "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3ccee"],
|
33 | 33 | "exception": "hashType is required"
|
| 34 | + }, |
| 35 | + "should throw an error when address format type is invalid(0x03)": { |
| 36 | + "params": ["0x36c329ed630d6ce750712a477543672adab57f4c", "0x03", "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"], |
| 37 | + "exception": "0x03 is not a valid address format type" |
34 | 38 | }
|
35 | 39 | },
|
36 | 40 | "fullPayloadToAddress": {
|
|
141 | 145 | "expected": [4, 24, 146, 234, 64, 216, 43, 83, 198, 120, 255, 136, 49, 36, 80, 187, 177, 126, 22, 77, 122, 62, 10, 144, 148, 26, 165, 136, 57, 245, 111, 141, 242, 54, 195, 41, 237, 99, 13, 108, 231, 80, 113, 42, 71, 117, 67, 103, 42, 218, 181, 127, 76]
|
142 | 146 | },
|
143 | 147 | "full version address identifies the hash_type": {
|
144 |
| - "params": ["ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqgqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgutrqyp"], |
145 |
| - "expected": [0, 52, 25, 161, 192, 158, 178, 86, 127, 101, 82, 238, 122, 142, 207, 253, 100, 21, 92, 255, 224, 241, 121, 110, 110, 97, 236, 8, 141, 116, 12, 19, 86, 1, 0, 23, 79, 178, 190, 46, 93, 12, 26, 59, 134, 148, 248, 50, 53, 10, 51, 193, 104, 93, 71, 122, 12, 1, 1] |
| 148 | + "params": ["ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqj0k2lzuhgvrgacvxtrw69"], |
| 149 | + "expected": [0, 155, 215, 224, 111, 62, 207, 75, 224, 242, 252, 210, 24, 139, 35, 241, 185, 252, 200, 142, 93, 75, 101, 168, 99, 123, 23, 114, 59, 189, 163, 204, 232, 2, 79, 178, 190, 46, 93, 12, 26, 59, 134] |
146 | 150 | },
|
147 | 151 | "should throw an error when short version address has invalid payload size": {
|
148 | 152 | "params": ["ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqqm65l9j"],
|
|
152 | 156 | "params": ["ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c"],
|
153 | 157 | "exception": "'ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c' is not a valid short version address"
|
154 | 158 | },
|
155 |
| - "should throw an error when address type is invalid": { |
156 |
| - "params": ["ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2"], |
157 |
| - "exception": "'ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2' is not a valid address" |
158 |
| - }, |
159 |
| - "should throw an error when hash type is invalid": { |
| 159 | + "should throw an error when deprecated address has invalid address type format 0x03": { |
160 | 160 | "params": ["ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2"],
|
161 | 161 | "exception": "'ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2' is not a valid address"
|
162 | 162 | },
|
|
168 | 168 | "params": ["ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw"],
|
169 | 169 | "exception": "'ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw' is not a valid full version address"
|
170 | 170 | },
|
171 |
| - "should throw an error when full version address identifies the hash_type has invalid code hash": { |
172 |
| - "params": ["ckb1qqv6rsy7kft87e2jaeaganlavs24ellq79ukumnpasyg6aqvzdtqzukxep"], |
173 |
| - "exception": "'ckb1qqv6rsy7kft87e2jaeaganlavs24ellq79ukumnpasyg6aqvzdtqzukxep' is not a valid address" |
| 171 | + "should throw an error when full version address has invalid code hash(bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8)": { |
| 172 | + "params": ["ckt1qq9a0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsjzla0h"], |
| 173 | + "exception": "'ckt1qq9a0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsjzla0h' is not a valid address" |
| 174 | + }, |
| 175 | + "should throw an error when full version address has invalid hash_type 0x03": { |
| 176 | + "params": ["ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqcvf0k9sc40s3azmpfvhyuudhahpsj72tseeza5p"], |
| 177 | + "exception": "'ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqcvf0k9sc40s3azmpfvhyuudhahpsj72tseeza5p' is not a valid address" |
| 178 | + }, |
| 179 | + "should throw an error when address format type is 0x00 but encode method is bech32": { |
| 180 | + "params": ["ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq20k2lzuhgvrgacv4tmr88"], |
| 181 | + "exception": "Address format type 0x00 doesn't match encode method bech32" |
| 182 | + }, |
| 183 | + "should throw an error when address format type is 0x01 but encode method is bech32m": { |
| 184 | + "params": ["ckb1qyqylv479ewscx3ms620sv34pgeuz6zagaaqh0knz7"], |
| 185 | + "exception": "Address format type 0x01 doesn't match encode method bech32m" |
| 186 | + }, |
| 187 | + "should throw an error when address format type is 0x02 but encode method is bech32m": { |
| 188 | + "params": ["ckb1q2da0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsnajhch96rq68wrqn2tmhm"], |
| 189 | + "exception": "Address format type 0x02 doesn't match encode method bech32m" |
174 | 190 | },
|
175 |
| - "should throw an error when full version address identifies the hash_type has invalid hash type": { |
176 |
| - "params": ["ckb1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqcqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgaxsc2r"], |
177 |
| - "exception": "'ckb1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqcqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgaxsc2r' is not a valid address" |
| 191 | + "should throw an error when address format type is 0x04 but encode method is bech32m": { |
| 192 | + "params": ["ckt1qjda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsrzta3vx9tuy0gkc2t9e88rdldcvyhjjuguz6rt"], |
| 193 | + "exception": "Address format type 0x04 doesn't match encode method bech32m" |
178 | 194 | }
|
179 | 195 | },
|
180 | 196 | "addressToScript": {
|
|
0 commit comments