mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-22 01:36:56 +01:00
Should not use deprecated constructor. Use Buffer.from.
This commit is contained in:
parent
e4d0efd967
commit
b7a9c960a2
@ -15,7 +15,7 @@ import nacl from 'tweetnacl'
|
|||||||
*/
|
*/
|
||||||
export default function Ed25519Keypair(seed) {
|
export default function Ed25519Keypair(seed) {
|
||||||
const keyPair = seed ? nacl.sign.keyPair.fromSeed(seed) : nacl.sign.keyPair()
|
const keyPair = seed ? nacl.sign.keyPair.fromSeed(seed) : nacl.sign.keyPair()
|
||||||
this.publicKey = base58.encode(new Buffer(keyPair.publicKey))
|
this.publicKey = base58.encode(Buffer.from(keyPair.publicKey))
|
||||||
// tweetnacl's generated secret key is the secret key + public key (resulting in a 64-byte buffer)
|
// tweetnacl's generated secret key is the secret key + public key (resulting in a 64-byte buffer)
|
||||||
this.privateKey = base58.encode(new Buffer(keyPair.secretKey.slice(0, 32)))
|
this.privateKey = base58.encode(Buffer.from(keyPair.secretKey.slice(0, 32)))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user