Skip to content

Commit 7f3c4dc

Browse files
authored
Merge pull request #596 from nervosnetwork/rc/v0.103.1
Release v0.103.1
2 parents e7cdfbc + 2de0b91 commit 7f3c4dc

File tree

15 files changed

+204
-71
lines changed

15 files changed

+204
-71
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)
7+
8+
9+
### Bug Fixes
10+
11+
* add address format type validation in utils.toAddressPayload ([8cf043c](https://github.com/nervosnetwork/ckb-sdk-js/commit/8cf043cbf6d89eef90c1eb55958ba609e71d2bba))
12+
* fix default code hash/code hash index in toAddressPayload ([e72a29d](https://github.com/nervosnetwork/ckb-sdk-js/commit/e72a29d46615bc09fc9ff726e30abb5f70ac26d7))
13+
* reinforce restriction of address format type and bech32(m) ([816e8ea](https://github.com/nervosnetwork/ckb-sdk-js/commit/816e8eab1154ca393b12ed1272f0bf8c753ac448))
14+
15+
16+
17+
18+
619
# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)
720

821

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ The ckb-sdk-js is still under development and aim for providing low-level APIs o
4040

4141
# TypeDoc
4242

43-
- [Global](https://nervosnetwork.github.io/ckb-sdk-js/globals.html)
44-
- [Core](https://nervosnetwork.github.io/ckb-sdk-js/classes/ckb.html)
45-
- [RPC](https://nervosnetwork.github.io/ckb-sdk-js/classes/ckbrpc.html)
46-
- [Types](https://nervosnetwork.github.io/ckb-sdk-js/modules/ckbcomponents.html)
43+
- [Global](https://nervosnetwork.github.io/ckb-sdk-js/index.html)
44+
- [Core](https://nervosnetwork.github.io/ckb-sdk-js/classes/_nervosnetwork_ckb_sdk_core.default.html)
45+
- [RPC](https://nervosnetwork.github.io/ckb-sdk-js/classes/_nervosnetwork_ckb_sdk_rpc.default.html)
46+
- [Types](https://nervosnetwork.github.io/ckb-sdk-js/modules/_nervosnetwork_ckb_types.CKBComponents.html)
4747

4848
# Introduction
4949

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
],
55
"npmClient": "yarn",
66
"useWorkspaces": true,
7-
"version": "0.103.0"
7+
"version": "0.103.1"
88
}

packages/ckb-sdk-core/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)
7+
8+
**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core
9+
10+
11+
12+
13+
614
# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)
715

816
**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core

packages/ckb-sdk-core/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nervosnetwork/ckb-sdk-core",
3-
"version": "0.103.0",
3+
"version": "0.103.1",
44
"description": "JavaScript SDK for Nervos Network CKB Project",
55
"author": "Nervos <dev@nervos.org>",
66
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
@@ -33,10 +33,10 @@
3333
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
3434
},
3535
"dependencies": {
36-
"@nervosnetwork/ckb-sdk-rpc": "0.103.0",
37-
"@nervosnetwork/ckb-sdk-utils": "0.103.0",
38-
"@nervosnetwork/ckb-types": "0.103.0",
36+
"@nervosnetwork/ckb-sdk-rpc": "0.103.1",
37+
"@nervosnetwork/ckb-sdk-utils": "0.103.1",
38+
"@nervosnetwork/ckb-types": "0.103.1",
3939
"tslib": "2.3.1"
4040
},
41-
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
41+
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
4242
}

packages/ckb-sdk-rpc/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)
7+
8+
**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc
9+
10+
11+
12+
13+
614
# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)
715

816
**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc

packages/ckb-sdk-rpc/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nervosnetwork/ckb-sdk-rpc",
3-
"version": "0.103.0",
3+
"version": "0.103.1",
44
"description": "RPC module of @nervosnetwork/ckb-sdk-core",
55
"author": "Nervos <dev@nervos.org>",
66
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js/packages/ckb-rpc#readme",
@@ -33,12 +33,12 @@
3333
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
3434
},
3535
"dependencies": {
36-
"@nervosnetwork/ckb-sdk-utils": "0.103.0",
36+
"@nervosnetwork/ckb-sdk-utils": "0.103.1",
3737
"axios": "0.21.4",
3838
"tslib": "2.3.1"
3939
},
4040
"devDependencies": {
41-
"@nervosnetwork/ckb-types": "0.103.0"
41+
"@nervosnetwork/ckb-types": "0.103.1"
4242
},
43-
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
43+
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
4444
}

packages/ckb-sdk-utils/CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)
7+
8+
9+
### Bug Fixes
10+
11+
* add address format type validation in utils.toAddressPayload ([8cf043c](https://github.com/nervosnetwork/ckb-sdk-js/commit/8cf043cbf6d89eef90c1eb55958ba609e71d2bba))
12+
* fix default code hash/code hash index in toAddressPayload ([e72a29d](https://github.com/nervosnetwork/ckb-sdk-js/commit/e72a29d46615bc09fc9ff726e30abb5f70ac26d7))
13+
* reinforce restriction of address format type and bech32(m) ([816e8ea](https://github.com/nervosnetwork/ckb-sdk-js/commit/816e8eab1154ca393b12ed1272f0bf8c753ac448))
14+
15+
16+
17+
18+
619
# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)
720

821

packages/ckb-sdk-utils/__tests__/address/fixtures.json

+29-13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"should throw an error when its a full version address but hash_type is missing while code hash is not secp256k1 code hash": {
3232
"params": ["0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64", "0x00", "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3ccee"],
3333
"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"
3438
}
3539
},
3640
"fullPayloadToAddress": {
@@ -141,8 +145,8 @@
141145
"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]
142146
},
143147
"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]
146150
},
147151
"should throw an error when short version address has invalid payload size": {
148152
"params": ["ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqqm65l9j"],
@@ -152,11 +156,7 @@
152156
"params": ["ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c"],
153157
"exception": "'ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c' is not a valid short version address"
154158
},
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": {
160160
"params": ["ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2"],
161161
"exception": "'ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2' is not a valid address"
162162
},
@@ -168,13 +168,29 @@
168168
"params": ["ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw"],
169169
"exception": "'ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw' is not a valid full version address"
170170
},
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"
174190
},
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"
178194
}
179195
},
180196
"addressToScript": {

packages/ckb-sdk-utils/__tests__/exceptions/fixtures.json

+14
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@
6262
"message": "'0x03' is not a valid hash type"
6363
}
6464
},
65+
"AddressFormatTypeException": {
66+
"params": [3],
67+
"expected": {
68+
"code": 104,
69+
"message": "0x03 is not a valid address format type"
70+
}
71+
},
72+
"AddressFormatTypeAndEncodeMethodNotMatchException": {
73+
"params": [3, "bech32"],
74+
"expected": {
75+
"code": 104,
76+
"message": "Address format type 0x03 doesn't match encode method bech32"
77+
}
78+
},
6579
"OutLenTooSmallException": {
6680
"params": [16, 32],
6781
"expected": {

packages/ckb-sdk-utils/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nervosnetwork/ckb-sdk-utils",
3-
"version": "0.103.0",
3+
"version": "0.103.1",
44
"description": "Utils module of @nervosnetwork/ckb-sdk-core",
55
"author": "Nervos <dev@nervos.org>",
66
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
@@ -31,7 +31,7 @@
3131
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
3232
},
3333
"dependencies": {
34-
"@nervosnetwork/ckb-types": "0.103.0",
34+
"@nervosnetwork/ckb-types": "0.103.1",
3535
"bech32": "2.0.0",
3636
"elliptic": "6.5.4",
3737
"jsbi": "3.1.3",
@@ -41,5 +41,5 @@
4141
"@types/bitcoinjs-lib": "5.0.0",
4242
"@types/elliptic": "6.4.12"
4343
},
44-
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
44+
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
4545
}

0 commit comments

Comments
 (0)