Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #79 from klaytn/release/v1.1.1
Browse files Browse the repository at this point in the history
[Master] release/v1.1.1 QA Sign-off
  • Loading branch information
jimni1222 authored Aug 26, 2019
2 parents 258a825 + 6099c95 commit d89069b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
- checkout
- run:
name: "Authenticate with registry"
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN > ~/repo/.npmrc"
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
- run:
name: "Publish package with rc tag"
command: |
echo "Publishing a release candidate! version=$CIRCLE_TAG"
echo "npm publish --tag rc" #remove " when its ready
npm publish --tag rc
- run:
name: "Push to release branch"
command: |
Expand Down Expand Up @@ -92,14 +92,14 @@ jobs:
git push origin v$current_version
- run:
name: "Authenticate with registry"
command: echo "//registry.npmjs.org/:_authToken=npm_TOKEN > ~/repo/.npmrc"
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
- run:
name: "Publish major version and delete release branch"
command: |
version=v$(.circleci/version.sh)
echo "Publishing a major release! version=$version"
echo "npm publish" #remove " when its ready
npm publish
#delete release branch. it trigger by merge title
if [[ "release/v" = $(git log --oneline -1 | grep -o "release/v") ]]; then
Expand Down
Empty file modified .circleci/version.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "caver-js",
"version": "1.0.0",
"version": "1.1.1",
"description": "caver-js is a JavaScript API library that allows developers to interact with a Klaytn node",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions packages/caver-utils/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ var stripHexPrefix = function (str) {
* Convert a input into a Buffer.
*
* @method toBuffer
* @param {Buffer|String|Number|BN|Object} input
* @param {Buffer|Array|String|Number|BN|Object} input
* @return {Buffer}
*/
var toBuffer = function (input) {
Expand All @@ -433,10 +433,10 @@ var toBuffer = function (input) {
}

/**
* Convert a Number to a Buffer.
* Convert a number to a Buffer.
*
* @method numberToBuffer
* @param {Number} num
* @param {Number|String|BN} num
* @return {Buffer}
*/
var numberToBuffer = function (num) {
Expand Down
11 changes: 11 additions & 0 deletions test/packages/caver.klay.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,4 +887,15 @@ describe('caver.utils.isHexParameter', () => {
expect(caver.utils.isHexParameter(Buffer.alloc(0))).to.be.false
expect(caver.utils.isHexParameter(new BN())).to.be.false
})
})

describe('caver.utils.xyPointFromPublicKey', () => {
it('caver.utils.xyPointFromPublicKey should return x, y point from publicKey', ()=>{
const account = caver.klay.accounts.create()
const publicKey = caver.klay.accounts.privateKeyToPublicKey(account.privateKey)
const xyPoint = caver.utils.xyPointFromPublicKey(publicKey)
expect(Array.isArray(xyPoint)).to.be.true
expect(xyPoint.length).to.equals(2)
expect(publicKey).to.equals(xyPoint[0]+xyPoint[1].slice(2))
})
})

0 comments on commit d89069b

Please sign in to comment.