Skip to content

Commit

Permalink
Merge pull request #59 from EOSIO/rc-bump
Browse files Browse the repository at this point in the history
Version bump
  • Loading branch information
jlamarr22 authored Jan 17, 2020
2 parents ec2a285 + 8e2c386 commit d5af79a
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 222 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ual-scatter",
"version": "0.1.6",
"version": "0.1.8",
"main": "dist/index.js",
"license": "MIT",
"author": {
Expand All @@ -21,10 +21,10 @@
"test": "jest"
},
"dependencies": {
"@scatterjs/core": "2.7.46",
"@scatterjs/eosjs2": "^1.5.29",
"@scatterjs/core": "2.7.51",
"@scatterjs/eosjs2": "1.5.33",
"elliptic": "6.5.2",
"eosjs": "20.0.4-e2c667e.0",
"eosjs": "21.0.1-rc1",
"universal-authenticator-library": "0.1.4"
},
"resolutions": {
Expand Down
7 changes: 5 additions & 2 deletions src/ScatterUser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { ec as EC } from 'elliptic'
import { Chain, RpcEndpoint, UALError, UALErrorType } from 'universal-authenticator-library'
import { ScatterUser } from './ScatterUser'
import { Signature, PrivateKey } from 'eosjs/dist/eosjs-jssig'
import { Numeric } from 'eosjs'

const { KeyType } = Numeric

const endpoint: RpcEndpoint = {
protocol: 'https',
Expand Down Expand Up @@ -133,7 +136,7 @@ describe('ScatterUser', () => {
const ellipticHashedString = ec.hash().update(dataAsString).digest()

const ellipticSig = KPrivElliptic.sign(ellipticHashedString)
const ellipticSigString = Signature.fromElliptic(ellipticSig).toString()
const ellipticSigString = Signature.fromElliptic(ellipticSig, KeyType.k1).toString()

const eosioPubKey = user.getPublicKey(dataAsString, ellipticSigString)
expect(eosioPubKey.toString()).toEqual(publicKeys[0])
Expand All @@ -148,7 +151,7 @@ describe('ScatterUser', () => {
const ellipticHashedString = ec.hash().update(dataAsString).digest()

const ellipticSig = KPrivElliptic.sign(ellipticHashedString)
const ellipticSigString = Signature.fromElliptic(ellipticSig).toString()
const ellipticSigString = Signature.fromElliptic(ellipticSig, KeyType.k1).toString()

const eosioPubKey = user.getPublicKey('other string', ellipticSigString)
expect(eosioPubKey.toString()).not.toEqual(publicKeys[0])
Expand Down
5 changes: 3 additions & 2 deletions src/ScatterUser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Api, JsonRpc } from 'eosjs'
import { Api, JsonRpc, Numeric } from 'eosjs'
import { ec as EC } from 'elliptic'
import { Signature, PublicKey } from 'eosjs/dist/eosjs-jssig'
import { Chain, SignTransactionResponse, UALErrorType, User } from 'universal-authenticator-library'
import { UALScatterError } from './UALScatterError'

const { KeyType } = Numeric
const ec = new EC('secp256k1')

export class ScatterUser extends User {
Expand Down Expand Up @@ -132,6 +133,6 @@ export class ScatterUser extends User {
'hex'
)
const ellipticPublicKey = ec.keyFromPublic(ellipticRecoveredPublicKey)
return PublicKey.fromElliptic(ellipticPublicKey).toString()
return PublicKey.fromElliptic(ellipticPublicKey, KeyType.k1).toString()
}
}
Loading

0 comments on commit d5af79a

Please sign in to comment.