rename seckey to prikey
This commit is contained in:
parent
8cf67bf90c
commit
76deb199a5
10
Action.js
10
Action.js
@ -44,15 +44,15 @@ MOM.packMe = async function (keypair) {
|
|||||||
this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey })
|
this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey })
|
||||||
this.timestamp = new Date()
|
this.timestamp = new Date()
|
||||||
|
|
||||||
await this.signMe(keypair.seckey)
|
await this.signMe(keypair.prikey)
|
||||||
this.hashMe()
|
this.hashMe()
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
MOM.signMe = async function (seckey) {
|
MOM.signMe = async function (prikey) {
|
||||||
// 由前端调用,后台不该进行签名
|
// 由前端调用,后台不该进行签名
|
||||||
let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature'] }) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash
|
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
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,9 +156,9 @@ DAD.buildUserAction = async function (action, keypair) {
|
|||||||
action &&
|
action &&
|
||||||
action.type &&
|
action.type &&
|
||||||
keypair &&
|
keypair &&
|
||||||
keypair.seckey &&
|
keypair.prikey &&
|
||||||
keypair.pubkey &&
|
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)
|
let typedAction = new wo[action.type](action)
|
||||||
typedAction.actorPubkey = keypair.pubkey
|
typedAction.actorPubkey = keypair.pubkey
|
||||||
|
@ -14,12 +14,12 @@ const MOM = DAD.prototype
|
|||||||
MOM.__proto__ = Action.prototype
|
MOM.__proto__ = Action.prototype
|
||||||
// MOM._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名
|
// MOM._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名
|
||||||
|
|
||||||
MOM.signMe = async function (seckey) {
|
MOM.signMe = async function (prikey) {
|
||||||
// 由前端调用,后台不该进行签名
|
// 由前端调用,后台不该进行签名
|
||||||
let json = this.getJson({
|
let json = this.getJson({
|
||||||
exclude: ['hash', 'blockHash', 'actorSignature', 'json']
|
exclude: ['hash', 'blockHash', 'actorSignature', 'json']
|
||||||
}) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash
|
}) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash
|
||||||
this.actorSignature = await ticc.sign_easy({ data: json, seckey })
|
this.actorSignature = await ticc.sign_easy({ data: json, prikey })
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ MOM.packMe = async function (keypair) {
|
|||||||
this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey })
|
this.actorAddress = ticc.pubkey_to_address({ pubkey: keypair.pubkey })
|
||||||
this.timestamp = new Date()
|
this.timestamp = new Date()
|
||||||
|
|
||||||
await this.signMe(keypair.seckey)
|
await this.signMe(keypair.prikey)
|
||||||
this.hashMe()
|
this.hashMe()
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user