Skip to content

Commit

Permalink
Merge pull request #421 from nervosnetwork/rc/v0.27.1
Browse files Browse the repository at this point in the history
[ᚬmaster] chore: update package versions and changelogs
  • Loading branch information
Keith-CY authored Feb 1, 2020
2 parents 426221a + 96e0dea commit f6fe01f
Show file tree
Hide file tree
Showing 21 changed files with 482 additions and 212 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ language: node_js
sudo: true

node_js:
- '11.9'
- '10.15'
- '12.13'
- '13.2'
- '12.14.1'
- '13.7'

cache:
- npm
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.27.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.27.0...v0.27.1) (2020-02-01)


### Features

* **rpc:** add the second paramter outputsValidator in the sendTransaction RPC method ([0c7b7b1](https://github.com/nervosnetwork/ckb-sdk-js/commit/0c7b7b1c4b5aa6847c8061ca1a98adad9186e3a7))


### BREAKING CHANGES

* **rpc:** Default outputsValidator on sending transactions requires the lock of outputs to be
the default lock script





# [0.27.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.26.4...v0.27.0) (2020-01-11)

**Note:** Version bump only for package ckb-sdk-js
Expand Down
4 changes: 3 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.27.0"
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.27.1"
}
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ci-install:
npm install -g codecov;
npm install;
lerna bootstrap --hoist --mutex file:/tmp/.yarn-mutex --concurrency=1;
lerna bootstrap --mutex file:/tmp/.yarn-mutex --concurrency=1;
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"name": "ckb-sdk-js",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"bootstrap": "lerna bootstrap",
"tsc": "lerna run tsc",
Expand Down Expand Up @@ -36,7 +40,7 @@
"eslint-plugin-prettier": "3.1.1",
"husky": "3.0.9",
"jest": "24.9.0",
"lerna": "3.18.4",
"lerna": "3.20.2",
"lint-staged": "9.4.2",
"prettier": "1.18.2",
"typedoc": "0.15.2",
Expand Down
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.27.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.27.0...v0.27.1) (2020-02-01)

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





# [0.27.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.26.4...v0.27.0) (2020-01-11)

**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.27.0",
"version": "0.27.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 @@ -31,9 +31,9 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-sdk-rpc": "0.27.0",
"@nervosnetwork/ckb-sdk-utils": "0.27.0",
"@nervosnetwork/ckb-types": "0.27.0"
"@nervosnetwork/ckb-sdk-rpc": "0.27.1",
"@nervosnetwork/ckb-sdk-utils": "0.27.1",
"@nervosnetwork/ckb-types": "0.27.1"
},
"gitHead": "452e737d8602410ecccc132143c6ee641c61a000"
"gitHead": "4d50cd0beecc413a0bfab2b47ff78b804af6af2a"
}
17 changes: 17 additions & 0 deletions packages/ckb-sdk-rpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.27.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.27.0...v0.27.1) (2020-02-01)


### Features

* **rpc:** add the second paramter outputsValidator in the sendTransaction RPC method ([0c7b7b1](https://github.com/nervosnetwork/ckb-sdk-js/commit/0c7b7b1c4b5aa6847c8061ca1a98adad9186e3a7))


### BREAKING CHANGES

* **rpc:** Default outputsValidator on sending transactions requires the lock of outputs to be
the default lock script





# [0.27.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.26.4...v0.27.0) (2020-01-11)

**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc
Expand Down
6 changes: 3 additions & 3 deletions packages/ckb-sdk-rpc/__tests__/ckb-rpc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ describe('ckb-rpc success', () => {
expect(header).toEqual(zeroBlockHeader)
})

it('estimate fee rate', async () => {
it.skip('estimate fee rate', async () => {
const feeRate = await rpc.estimateFeeRate('0x11')
expect(feeRate).toBeTruthy()
})
})

describe('send transaction', () => {
describe.skip('send transaction', () => {
it('send transaction', async () => {
const tx = {
cellDeps: [
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('send transaction', () => {
outputsData: ['0x'],
witnesses: [],
}
const hash = rpc.sendTransaction(tx)
const hash = await rpc.sendTransaction(tx)
expect(hash).toBeTruthy()
})
})
Expand Down
18 changes: 18 additions & 0 deletions packages/ckb-sdk-rpc/__tests__/formatters/params.fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,23 @@
{
"expected": false
}
],
"toOutputsValidator": [
{
"param": "default",
"expected": "default"
},
{
"param": "passthrough",
"expected": "passthrough"
},
{
"param": "undefined",
"expected": "undefined"
},
{
"param": "unknown",
"exception": "Outputs validator should be default or passthrough"
}
]
}
4 changes: 2 additions & 2 deletions packages/ckb-sdk-rpc/__tests__/formatters/params.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const fixtures = require('./params.fixtures.json')
describe('params formatter', () => {
describe.each(Object.keys(fixtures))('%s', methodName => {
const fixtureTable = Object.values(fixtures[methodName]).map(({ param, expected, exception }) => [
param,
expected,
param === 'undefined' ? undefined : param,
expected === 'undefined' ? undefined : expected,
exception,
])
test.each(fixtureTable)('%j => %j', (param, expected, exception) => {
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.27.0",
"version": "0.27.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.27.0",
"@nervosnetwork/ckb-sdk-utils": "0.27.1",
"axios": "0.19.0"
},
"devDependencies": {
"@nervosnetwork/ckb-types": "0.27.0",
"@nervosnetwork/ckb-types": "0.27.1",
"dotenv": "8.1.0"
},
"gitHead": "452e737d8602410ecccc132143c6ee641c61a000"
"gitHead": "4d50cd0beecc413a0bfab2b47ff78b804af6af2a"
}
10 changes: 8 additions & 2 deletions packages/ckb-sdk-rpc/src/defaultRPC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const defaultRPC: CKBComponents.Method[] = [
{
name: 'sendTransaction',
method: 'send_transaction',
paramsFormatters: [paramsFmts.toRawTransaction],
paramsFormatters: [paramsFmts.toRawTransaction, paramsFmts.toOutputsValidator],
resultFormatters: resultFmts.toHash,
},
{
Expand Down Expand Up @@ -273,9 +273,15 @@ export class DefaultRPC {
* @description rpc to send a new transaction into transaction pool
* @param {object} rawTransaction - a raw transaction includes cell deps, inputs, outputs, version, and witnesses,
* detailed info could be found in ckb-types
* @param {string} [outputsValidator] - Validates the transaction outputs before entering the tx-pool,
* an optional string parameter (enum: default | passthrough ),
* null means using default validator, passthrough means skipping outputs validation
* @return {Promise<string>} transaction hash
*/
public sendTransaction!: (tx: CKBComponents.RawTransaction) => Promise<CKBComponents.Hash>
public sendTransaction!: (
tx: CKBComponents.RawTransaction,
outputsValidator: CKBComponents.OutputsValidator,
) => Promise<CKBComponents.Hash>

/**
* @method getBlockchainInfo
Expand Down
8 changes: 8 additions & 0 deletions packages/ckb-sdk-rpc/src/paramsFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ const formatter = {
return formatter.toNumber(`0x${size.toString(16)}`)
},
toReverseOrder: (reverse: boolean = false) => !!reverse,
toOutputsValidator: (outputsValidator: CKBComponents.OutputsValidator) => {
if (!outputsValidator) return undefined
const VALIDATORS = ['default', 'passthrough']
if (VALIDATORS.indexOf(outputsValidator) > -1) {
return outputsValidator
}
throw new TypeError('Outputs validator should be default or passthrough')
},
}

export default formatter
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-sdk-rpc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"lib": ["es6"],
"outDir": "./lib",
"typeRoots": ["types", "node_modules/@types", "node_modules"],
"types": ["@nervosnetwork/ckb-types", "@nervosnetwork/ckb-sdk-utils", "rpc"]
Expand Down
8 changes: 8 additions & 0 deletions packages/ckb-sdk-utils/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.27.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.27.0...v0.27.1) (2020-02-01)

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





# [0.27.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.26.4...v0.27.0) (2020-01-11)

**Note:** Version bump only for package @nervosnetwork/ckb-sdk-utils
Expand Down
8 changes: 4 additions & 4 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.27.0",
"version": "0.27.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,15 +31,15 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-types": "0.27.0",
"@nervosnetwork/ckb-types": "0.27.1",
"blake2b-wasm": "2.1.0",
"elliptic": "6.5.1",
"elliptic": "6.5.2",
"jsbi": "3.1.1"
},
"devDependencies": {
"@types/bitcoinjs-lib": "4.0.1",
"@types/elliptic": "6.4.8",
"@types/utf8": "2.1.6"
},
"gitHead": "452e737d8602410ecccc132143c6ee641c61a000"
"gitHead": "4d50cd0beecc413a0bfab2b47ff78b804af6af2a"
}
17 changes: 17 additions & 0 deletions packages/ckb-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.27.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.27.0...v0.27.1) (2020-02-01)


### Features

* **rpc:** add the second paramter outputsValidator in the sendTransaction RPC method ([0c7b7b1](https://github.com/nervosnetwork/ckb-sdk-js/commit/0c7b7b1c4b5aa6847c8061ca1a98adad9186e3a7))


### BREAKING CHANGES

* **rpc:** Default outputsValidator on sending transactions requires the lock of outputs to be
the default lock script





# [0.27.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.26.4...v0.27.0) (2020-01-11)

**Note:** Version bump only for package @nervosnetwork/ckb-types
Expand Down
1 change: 1 addition & 0 deletions packages/ckb-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ declare namespace CKBComponents {
export type Nonce = string
export type Cycles = string
export type Size = string
export type OutputsValidator = 'default' | 'passthrough' | undefined
export enum TransactionStatus {
Pending = 'pending',
Proposed = 'proposed',
Expand Down
4 changes: 2 additions & 2 deletions packages/ckb-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervosnetwork/ckb-types",
"version": "0.27.0",
"version": "0.27.1",
"description": "Type module of @nervosnetwork/ckb-sdk-core",
"author": "Nervos <[email protected]>",
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
Expand All @@ -23,5 +23,5 @@
"scripts": {
"doc": "../../node_modules/.bin/typedoc --out docs ./index.d.ts --mode modules --includeDeclarations --excludeExternals --ignoreCompilerErrors --theme default --readme README.md"
},
"gitHead": "452e737d8602410ecccc132143c6ee641c61a000"
"gitHead": "4d50cd0beecc413a0bfab2b47ff78b804af6af2a"
}
Loading

0 comments on commit f6fe01f

Please sign in to comment.