rename ticc.sign/verify/encrypt/decrypt/hash to ticc.xxx_easy
This commit is contained in:
13
Action.js
13
Action.js
@@ -52,18 +52,22 @@ MOM.packMe = async function (keypair) {
|
||||
MOM.signMe = async function (seckey) {
|
||||
// 由前端调用,后台不该进行签名
|
||||
let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature'] }) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash
|
||||
this.actorSignature = await ticc.sign(json, seckey)
|
||||
this.actorSignature = await ticc.sign_easy({ data: json, seckey })
|
||||
return this
|
||||
}
|
||||
|
||||
MOM.hashMe = function () {
|
||||
this.hash = ticc.hash(this.getJson({ exclude: ['hash', 'blockHash'] })) // block.hash 受到所包含的actionList影响,所以action不能受blockHash影响,否则循环了
|
||||
this.hash = ticc.hash_easy(this.getJson({ exclude: ['hash', 'blockHash'] })) // block.hash 受到所包含的actionList影响,所以action不能受blockHash影响,否则循环了
|
||||
return this
|
||||
}
|
||||
|
||||
MOM.verifySig = async function () {
|
||||
let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature'] })
|
||||
let result = await ticc.verify(json, this.actorSignature, this.actorPubkey)
|
||||
let result = await ticc.verify_easy({
|
||||
data: json,
|
||||
signature: this.actorSignature,
|
||||
pubkey: this.actorPubkey
|
||||
})
|
||||
return result
|
||||
}
|
||||
DAD.verifySig = async function (actionData) {
|
||||
@@ -83,7 +87,8 @@ DAD.verifyAddress = function (actionData) {
|
||||
|
||||
MOM.verifyHash = function () {
|
||||
return (
|
||||
this.hash === ticc.hash(this.getJson({ exclude: ['hash', 'blockHash'] }))
|
||||
this.hash ===
|
||||
ticc.hash_easy(this.getJson({ exclude: ['hash', 'blockHash'] }))
|
||||
)
|
||||
}
|
||||
DAD.verifyHash = function (actionData) {
|
||||
|
||||
Reference in New Issue
Block a user