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 #83 from klaytn/release/v1.1.2
Browse files Browse the repository at this point in the history
[Master] release/v1.1.2 QA Sign-off
  • Loading branch information
jimni1222 authored Aug 27, 2019
2 parents d89069b + 3f0649e commit d225637
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
- run:
name: "Authenticate with registry"
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
- run:
name: "Update version in package.json"
command: |
tag=$CIRCLE_TAG
sed -i "s/\"version\": \".*\",/\"version\": \"${tag}\",/" package.json
- run:
name: "Publish package with rc tag"
command: |
Expand Down
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.1.1",
"version": "1.1.2",
"description": "caver-js is a JavaScript API library that allows developers to interact with a Klaytn node",
"main": "index.js",
"scripts": {
Expand Down
26 changes: 25 additions & 1 deletion test/packages/caver.klay.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,30 @@ describe('caver.utils.xyPointFromPublicKey', () => {
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))
expect(publicKey).to.equals(caver.utils.leftPad(xyPoint[0], 64)+caver.utils.leftPad(xyPoint[1], 64).slice(2))
})

it('caver.utils.xyPointFromPublicKey should return x, y point remove leading zeros', ()=>{
const publicKey1 = '0x046241c7524030e5b44fff78021e35227d708c8630757b35090d56527b615f605b8d366782c86dee49356be574e1172f75ef5ce5d03b6e8c17dbf10f3fa2d9a3'
const publicKey2 = '0xba7135b75cae89b958e7bb78009bda52f6a348150757cc078e3e5e5d25519c500ed4ccec1f78ba4e1c21c7b1e57751cec4cf42e3997a476e3ecbf360ad095336'
const publicKey3 = '0x12b97e6756861ac0257a240d985d761cee9ca7719a29c233c644cfcc421885000c8e4c69cdb71665377b9e8ffb702355ca53917e66c7444619049c3dd0252ab6'
const publicKey4 = '0x05b3b58259770871a1cc18534f2d438935fa2dcdb04116cbfbde8adfe858c23e50047c5aea3c2f55de7de04203f8fe8ccc3b491029338d038a7ef6d6903b302e'

const xyPoint1 = caver.utils.xyPointFromPublicKey(publicKey1)
const xyPoint2 = caver.utils.xyPointFromPublicKey(publicKey2)
const xyPoint3 = caver.utils.xyPointFromPublicKey(publicKey3)
const xyPoint4 = caver.utils.xyPointFromPublicKey(publicKey4)

expect(xyPoint1[0]).to.equals('0x46241c7524030e5b44fff78021e35227d708c8630757b35090d56527b615f60')
expect(xyPoint1[1]).to.equals('0x5b8d366782c86dee49356be574e1172f75ef5ce5d03b6e8c17dbf10f3fa2d9a3')

expect(xyPoint2[0]).to.equals('0xba7135b75cae89b958e7bb78009bda52f6a348150757cc078e3e5e5d25519c50')
expect(xyPoint2[1]).to.equals('0xed4ccec1f78ba4e1c21c7b1e57751cec4cf42e3997a476e3ecbf360ad095336')

expect(xyPoint3[0]).to.equals('0x12b97e6756861ac0257a240d985d761cee9ca7719a29c233c644cfcc42188500')
expect(xyPoint3[1]).to.equals('0xc8e4c69cdb71665377b9e8ffb702355ca53917e66c7444619049c3dd0252ab6')

expect(xyPoint4[0]).to.equals('0x5b3b58259770871a1cc18534f2d438935fa2dcdb04116cbfbde8adfe858c23e')
expect(xyPoint4[1]).to.equals('0x50047c5aea3c2f55de7de04203f8fe8ccc3b491029338d038a7ef6d6903b302e')
})
})

0 comments on commit d225637

Please sign in to comment.