Skip to content

Commit

Permalink
Merge pull request #596 from nervosnetwork/rc/v0.103.1
Browse files Browse the repository at this point in the history
Release v0.103.1
  • Loading branch information
Keith-CY authored May 31, 2022
2 parents e7cdfbc + 2de0b91 commit 7f3c4dc
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 71 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)


### Bug Fixes

* add address format type validation in utils.toAddressPayload ([8cf043c](https://github.com/nervosnetwork/ckb-sdk-js/commit/8cf043cbf6d89eef90c1eb55958ba609e71d2bba))
* fix default code hash/code hash index in toAddressPayload ([e72a29d](https://github.com/nervosnetwork/ckb-sdk-js/commit/e72a29d46615bc09fc9ff726e30abb5f70ac26d7))
* reinforce restriction of address format type and bech32(m) ([816e8ea](https://github.com/nervosnetwork/ckb-sdk-js/commit/816e8eab1154ca393b12ed1272f0bf8c753ac448))





# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)


Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ The ckb-sdk-js is still under development and aim for providing low-level APIs o

# TypeDoc

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

# Introduction

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.103.0"
"version": "0.103.1"
}
8 changes: 8 additions & 0 deletions packages/ckb-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)

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





# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)

**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core
Expand Down
10 changes: 5 additions & 5 deletions packages/ckb-sdk-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervosnetwork/ckb-sdk-core",
"version": "0.103.0",
"version": "0.103.1",
"description": "JavaScript SDK for Nervos Network CKB Project",
"author": "Nervos <[email protected]>",
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
Expand Down Expand Up @@ -33,10 +33,10 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-sdk-rpc": "0.103.0",
"@nervosnetwork/ckb-sdk-utils": "0.103.0",
"@nervosnetwork/ckb-types": "0.103.0",
"@nervosnetwork/ckb-sdk-rpc": "0.103.1",
"@nervosnetwork/ckb-sdk-utils": "0.103.1",
"@nervosnetwork/ckb-types": "0.103.1",
"tslib": "2.3.1"
},
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
}
8 changes: 8 additions & 0 deletions packages/ckb-sdk-rpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)

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





# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)

**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc
Expand Down
8 changes: 4 additions & 4 deletions packages/ckb-sdk-rpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervosnetwork/ckb-sdk-rpc",
"version": "0.103.0",
"version": "0.103.1",
"description": "RPC module of @nervosnetwork/ckb-sdk-core",
"author": "Nervos <[email protected]>",
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js/packages/ckb-rpc#readme",
Expand Down Expand Up @@ -33,12 +33,12 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-sdk-utils": "0.103.0",
"@nervosnetwork/ckb-sdk-utils": "0.103.1",
"axios": "0.21.4",
"tslib": "2.3.1"
},
"devDependencies": {
"@nervosnetwork/ckb-types": "0.103.0"
"@nervosnetwork/ckb-types": "0.103.1"
},
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
}
13 changes: 13 additions & 0 deletions packages/ckb-sdk-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.103.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.1) (2022-05-31)


### Bug Fixes

* add address format type validation in utils.toAddressPayload ([8cf043c](https://github.com/nervosnetwork/ckb-sdk-js/commit/8cf043cbf6d89eef90c1eb55958ba609e71d2bba))
* fix default code hash/code hash index in toAddressPayload ([e72a29d](https://github.com/nervosnetwork/ckb-sdk-js/commit/e72a29d46615bc09fc9ff726e30abb5f70ac26d7))
* reinforce restriction of address format type and bech32(m) ([816e8ea](https://github.com/nervosnetwork/ckb-sdk-js/commit/816e8eab1154ca393b12ed1272f0bf8c753ac448))





# [0.103.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.102.3...v0.103.0) (2022-05-09)


Expand Down
42 changes: 29 additions & 13 deletions packages/ckb-sdk-utils/__tests__/address/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"should throw an error when its a full version address but hash_type is missing while code hash is not secp256k1 code hash": {
"params": ["0xb39bbc0b3673c7d36450bc14cfcdad2d559c6c64", "0x00", "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3ccee"],
"exception": "hashType is required"
},
"should throw an error when address format type is invalid(0x03)": {
"params": ["0x36c329ed630d6ce750712a477543672adab57f4c", "0x03", "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"],
"exception": "0x03 is not a valid address format type"
}
},
"fullPayloadToAddress": {
Expand Down Expand Up @@ -141,8 +145,8 @@
"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]
},
"full version address identifies the hash_type": {
"params": ["ckt1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqgqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgutrqyp"],
"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]
"params": ["ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqj0k2lzuhgvrgacvxtrw69"],
"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]
},
"should throw an error when short version address has invalid payload size": {
"params": ["ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqqm65l9j"],
Expand All @@ -152,11 +156,7 @@
"params": ["ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c"],
"exception": "'ckt1qyprdsefa43s6m882pcj53m4gdnj4k440axqqfmyd9c' is not a valid short version address"
},
"should throw an error when address type is invalid": {
"params": ["ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2"],
"exception": "'ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2' is not a valid address"
},
"should throw an error when hash type is invalid": {
"should throw an error when deprecated address has invalid address type format 0x03": {
"params": ["ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2"],
"exception": "'ckt1qwn9dutjk669cfznq7httfar0gtk7qp0du3wjfvzck9l0w3k9eqhvdkr98kkxrtvuag8z2j8w4pkw2k6k4l5ctv25r2' is not a valid address"
},
Expand All @@ -168,13 +168,29 @@
"params": ["ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw"],
"exception": "'ckb1qsqcjt4ypkpt20r83lugxyj9pwa30cty6737p2gfgx493qul2cgvrxhw' is not a valid full version address"
},
"should throw an error when full version address identifies the hash_type has invalid code hash": {
"params": ["ckb1qqv6rsy7kft87e2jaeaganlavs24ellq79ukumnpasyg6aqvzdtqzukxep"],
"exception": "'ckb1qqv6rsy7kft87e2jaeaganlavs24ellq79ukumnpasyg6aqvzdtqzukxep' is not a valid address"
"should throw an error when full version address has invalid code hash(bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8)": {
"params": ["ckt1qq9a0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsjzla0h"],
"exception": "'ckt1qq9a0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsjzla0h' is not a valid address"
},
"should throw an error when full version address has invalid hash_type 0x03": {
"params": ["ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqcvf0k9sc40s3azmpfvhyuudhahpsj72tseeza5p"],
"exception": "'ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqcvf0k9sc40s3azmpfvhyuudhahpsj72tseeza5p' is not a valid address"
},
"should throw an error when address format type is 0x00 but encode method is bech32": {
"params": ["ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq20k2lzuhgvrgacv4tmr88"],
"exception": "Address format type 0x00 doesn't match encode method bech32"
},
"should throw an error when address format type is 0x01 but encode method is bech32m": {
"params": ["ckb1qyqylv479ewscx3ms620sv34pgeuz6zagaaqh0knz7"],
"exception": "Address format type 0x01 doesn't match encode method bech32m"
},
"should throw an error when address format type is 0x02 but encode method is bech32m": {
"params": ["ckb1q2da0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsnajhch96rq68wrqn2tmhm"],
"exception": "Address format type 0x02 doesn't match encode method bech32m"
},
"should throw an error when full version address identifies the hash_type has invalid hash type": {
"params": ["ckb1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqcqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgaxsc2r"],
"exception": "'ckb1qq6pngwqn6e9vlm92th84rk0l4jp2h8lurchjmnwv8kq3rt5psf4vqcqza8m903wt5xp5wuxjnurydg2x0qksh280gxqzqgaxsc2r' is not a valid address"
"should throw an error when address format type is 0x04 but encode method is bech32m": {
"params": ["ckt1qjda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsrzta3vx9tuy0gkc2t9e88rdldcvyhjjuguz6rt"],
"exception": "Address format type 0x04 doesn't match encode method bech32m"
}
},
"addressToScript": {
Expand Down
14 changes: 14 additions & 0 deletions packages/ckb-sdk-utils/__tests__/exceptions/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@
"message": "'0x03' is not a valid hash type"
}
},
"AddressFormatTypeException": {
"params": [3],
"expected": {
"code": 104,
"message": "0x03 is not a valid address format type"
}
},
"AddressFormatTypeAndEncodeMethodNotMatchException": {
"params": [3, "bech32"],
"expected": {
"code": 104,
"message": "Address format type 0x03 doesn't match encode method bech32"
}
},
"OutLenTooSmallException": {
"params": [16, 32],
"expected": {
Expand Down
6 changes: 3 additions & 3 deletions packages/ckb-sdk-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervosnetwork/ckb-sdk-utils",
"version": "0.103.0",
"version": "0.103.1",
"description": "Utils module of @nervosnetwork/ckb-sdk-core",
"author": "Nervos <[email protected]>",
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
Expand Down Expand Up @@ -31,7 +31,7 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-types": "0.103.0",
"@nervosnetwork/ckb-types": "0.103.1",
"bech32": "2.0.0",
"elliptic": "6.5.4",
"jsbi": "3.1.3",
Expand All @@ -41,5 +41,5 @@
"@types/bitcoinjs-lib": "5.0.0",
"@types/elliptic": "6.4.12"
},
"gitHead": "381148346ef0243b12dfcd872ea15d9f59e07a9e"
"gitHead": "51d076e98f34cf15dda4bc5f3e434f1f6de54bb7"
}
Loading

0 comments on commit 7f3c4dc

Please sign in to comment.