From 76deb199a57ae5f138a65ce1a3a657506cc7da65 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 14 Aug 2022 15:51:24 +0800 Subject: [PATCH] rename seckey to prikey --- Action.js | 10 +++++----- ActionMultisig.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Action.js b/Action.js index af77708..dd9ddf6 100644 --- a/Action.js +++ b/Action.js @@ -44,15 +44,15 @@ MOM.packMe = async function (keypair) { this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey }) this.timestamp = new Date() - await this.signMe(keypair.seckey) + await this.signMe(keypair.prikey) this.hashMe() return this } -MOM.signMe = async function (seckey) { +MOM.signMe = async function (prikey) { // 由前端调用,后台不该进行签名 let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature'] }) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash - this.actorSignature = await ticc.sign_easy({ data: json, seckey }) + this.actorSignature = await ticc.sign_easy({ data: json, prikey }) return this } @@ -156,9 +156,9 @@ DAD.buildUserAction = async function (action, keypair) { action && action.type && keypair && - keypair.seckey && + keypair.prikey && keypair.pubkey && - ticc.seckey_to_pubkey({ seckey: keypair.seckey }) === keypair.pubkey + ticc.seckey_to_pubkey({ prikey: keypair.prikey }) === keypair.pubkey ) { let typedAction = new wo[action.type](action) typedAction.actorPubkey = keypair.pubkey diff --git a/ActionMultisig.js b/ActionMultisig.js index c2603eb..5e9e79c 100644 --- a/ActionMultisig.js +++ b/ActionMultisig.js @@ -14,12 +14,12 @@ const MOM = DAD.prototype MOM.__proto__ = Action.prototype // MOM._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名 -MOM.signMe = async function (seckey) { +MOM.signMe = async function (prikey) { // 由前端调用,后台不该进行签名 let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature', 'json'] }) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash - this.actorSignature = await ticc.sign_easy({ data: json, seckey }) + this.actorSignature = await ticc.sign_easy({ data: json, prikey }) return this } @@ -61,7 +61,7 @@ MOM.packMe = async function (keypair) { this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey }) this.timestamp = new Date() - await this.signMe(keypair.seckey) + await this.signMe(keypair.prikey) this.hashMe() return this }