From bbba2589d5ffb2a019e3e86901ef6c2c88c0b63e Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Wed, 3 Aug 2022 16:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E5=A4=A7=E5=A4=9A=E6=95=B0ticc?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=B8=BA=20{=20...=20}=20=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- btc.js | 3 ++- tic.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/btc.js b/btc.js index 7167d40..4cea30b 100644 --- a/btc.js +++ b/btc.js @@ -10,7 +10,8 @@ const BTC_TXFEE = 30 class BTC { constructor (privateKey) { - if (!ticc.is_seckey(privateKey)) throw new Error('Invalid PrivateKey') + if (!ticc.is_seckey({ seckey: privateKey })) + throw new Error('Invalid PrivateKey') var publicKey = ticc.seckey_to_pubkey(privateKey) Object.defineProperties(this, { privateKey: { diff --git a/tic.js b/tic.js index 5f7bd98..396bc0a 100644 --- a/tic.js +++ b/tic.js @@ -8,7 +8,7 @@ const TIC_NODE = require('./netConfig').TIC_NODE class TIC { constructor (seckey, option = {}) { - if (!seckey || !ticc.is_seckey(seckey)) throw 'ERROR:Invalid Seckey' + if (!seckey || !ticc.is_seckey({ seckey })) throw 'ERROR:Invalid Seckey' Object.defineProperties(this, { seckey: { value: seckey,