Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
23cc6e46
Commit
23cc6e46
authored
Apr 08, 2019
by
kingwang
Committed by
33cn
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 04/08
parent
ccaff680
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
116 additions
and
58 deletions
+116
-58
exec.go
plugin/dapp/js/executor/exec.go
+2
-2
exec_del_local.go
plugin/dapp/js/executor/exec_del_local.go
+4
-11
exec_local.go
plugin/dapp/js/executor/exec_local.go
+2
-7
key.go
plugin/dapp/js/executor/key.go
+2
-18
query.go
plugin/dapp/js/executor/query.go
+1
-1
types.go
.../github.com/33cn/chain33/system/dapp/coins/types/types.go
+8
-5
driver.go
vendor/github.com/33cn/chain33/system/dapp/driver.go
+24
-0
driver_test.go
vendor/github.com/33cn/chain33/system/dapp/driver_test.go
+38
-0
key_test.go
vendor/github.com/33cn/chain33/types/key_test.go
+15
-0
localkv.go
vendor/github.com/33cn/chain33/types/localkv.go
+20
-14
No files found.
plugin/dapp/js/executor/exec.go
View file @
23cc6e46
...
@@ -17,7 +17,7 @@ func (c *js) Exec_Create(payload *jsproto.Create, tx *types.Transaction, index i
...
@@ -17,7 +17,7 @@ func (c *js) Exec_Create(payload *jsproto.Create, tx *types.Transaction, index i
if
string
(
tx
.
Execer
)
!=
ptypes
.
JsX
{
if
string
(
tx
.
Execer
)
!=
ptypes
.
JsX
{
return
nil
,
types
.
ErrExecNameNotMatch
return
nil
,
types
.
ErrExecNameNotMatch
}
}
c
.
prefix
=
c
alcStatePrefix
([]
byte
(
execer
))
c
.
prefix
=
types
.
C
alcStatePrefix
([]
byte
(
execer
))
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetStateDB
(),
c
.
prefix
,
nil
)
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetStateDB
(),
c
.
prefix
,
nil
)
_
,
err
=
kvc
.
GetNoPrefix
(
calcCodeKey
(
payload
.
Name
))
_
,
err
=
kvc
.
GetNoPrefix
(
calcCodeKey
(
payload
.
Name
))
if
err
!=
nil
&&
err
!=
types
.
ErrNotFound
{
if
err
!=
nil
&&
err
!=
types
.
ErrNotFound
{
...
@@ -45,7 +45,7 @@ func (c *js) Exec_Call(payload *jsproto.Call, tx *types.Transaction, index int)
...
@@ -45,7 +45,7 @@ func (c *js) Exec_Call(payload *jsproto.Call, tx *types.Transaction, index int)
if
string
(
tx
.
Execer
)
!=
execer
{
if
string
(
tx
.
Execer
)
!=
execer
{
return
nil
,
types
.
ErrExecNameNotMatch
return
nil
,
types
.
ErrExecNameNotMatch
}
}
c
.
prefix
=
c
alcStatePrefix
([]
byte
(
execer
))
c
.
prefix
=
types
.
C
alcStatePrefix
([]
byte
(
execer
))
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetStateDB
(),
c
.
prefix
,
nil
)
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetStateDB
(),
c
.
prefix
,
nil
)
jsvalue
,
err
:=
c
.
callVM
(
"exec"
,
payload
,
tx
,
index
,
nil
)
jsvalue
,
err
:=
c
.
callVM
(
"exec"
,
payload
,
tx
,
index
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
plugin/dapp/js/executor/exec_del_local.go
View file @
23cc6e46
package
executor
package
executor
import
(
import
(
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
"github.com/33cn/plugin/plugin/dapp/js/types/jsproto"
"github.com/33cn/plugin/plugin/dapp/js/types/jsproto"
...
@@ -12,19 +11,13 @@ func (c *js) ExecDelLocal_Create(payload *jsproto.Create, tx *types.Transaction,
...
@@ -12,19 +11,13 @@ func (c *js) ExecDelLocal_Create(payload *jsproto.Create, tx *types.Transaction,
}
}
func
(
c
*
js
)
ExecDelLocal_Call
(
payload
*
jsproto
.
Call
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
js
)
ExecDelLocal_Call
(
payload
*
jsproto
.
Call
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
krollback
:=
calcRollbackKey
(
tx
.
Hash
())
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
c
.
prefix
=
calcLocalPrefix
([]
byte
(
execer
))
r
:=
&
types
.
LocalDBSet
{}
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetLocalDB
(),
c
.
prefix
,
krollback
)
c
.
prefix
=
types
.
CalcLocalPrefix
([]
byte
(
execer
)
)
kvs
,
err
:=
kvc
.
GetRollbackKVList
(
)
kvs
,
err
:=
c
.
DelRollbackKV
(
tx
,
[]
byte
(
execer
)
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
for
_
,
kv
:=
range
kvs
{
r
.
KV
=
kvs
kvc
.
AddNoPrefix
(
kv
.
Key
,
kv
.
Value
)
}
kvc
.
DelRollbackKV
()
r
:=
&
types
.
LocalDBSet
{}
r
.
KV
=
kvc
.
KVList
()
return
r
,
nil
return
r
,
nil
}
}
plugin/dapp/js/executor/exec_local.go
View file @
23cc6e46
package
executor
package
executor
import
(
import
(
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
"github.com/33cn/plugin/plugin/dapp/js/types/jsproto"
"github.com/33cn/plugin/plugin/dapp/js/types/jsproto"
...
@@ -12,10 +11,8 @@ func (c *js) ExecLocal_Create(payload *jsproto.Create, tx *types.Transaction, re
...
@@ -12,10 +11,8 @@ func (c *js) ExecLocal_Create(payload *jsproto.Create, tx *types.Transaction, re
}
}
func
(
c
*
js
)
ExecLocal_Call
(
payload
*
jsproto
.
Call
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
js
)
ExecLocal_Call
(
payload
*
jsproto
.
Call
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
k
:=
calcRollbackKey
(
tx
.
Hash
())
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
c
.
prefix
=
calcLocalPrefix
([]
byte
(
execer
))
c
.
prefix
=
types
.
CalcLocalPrefix
([]
byte
(
execer
))
kvc
:=
dapp
.
NewKVCreator
(
c
.
GetLocalDB
(),
c
.
prefix
,
k
)
jsvalue
,
err
:=
c
.
callVM
(
"execlocal"
,
payload
,
tx
,
index
,
receiptData
)
jsvalue
,
err
:=
c
.
callVM
(
"execlocal"
,
payload
,
tx
,
index
,
receiptData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -24,9 +21,7 @@ func (c *js) ExecLocal_Call(payload *jsproto.Call, tx *types.Transaction, receip
...
@@ -24,9 +21,7 @@ func (c *js) ExecLocal_Call(payload *jsproto.Call, tx *types.Transaction, receip
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
kvc
.
AddListNoPrefix
(
kvs
)
kvc
.
AddRollbackKV
()
r
:=
&
types
.
LocalDBSet
{}
r
:=
&
types
.
LocalDBSet
{}
r
.
KV
=
kvc
.
KVList
(
)
r
.
KV
=
c
.
AddRollbackKV
(
tx
,
[]
byte
(
execer
),
kvs
)
return
r
,
nil
return
r
,
nil
}
}
plugin/dapp/js/executor/key.go
View file @
23cc6e46
...
@@ -5,29 +5,13 @@ import (
...
@@ -5,29 +5,13 @@ import (
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/js/types"
)
)
func
calcLocalPrefix
(
execer
[]
byte
)
[]
byte
{
s
:=
append
([]
byte
(
"LODB-"
),
execer
...
)
s
=
append
(
s
,
byte
(
'-'
))
return
s
}
func
calcStatePrefix
(
execer
[]
byte
)
[]
byte
{
s
:=
append
([]
byte
(
"mavl-"
),
execer
...
)
s
=
append
(
s
,
byte
(
'-'
))
return
s
}
func
calcAllPrefix
(
name
string
)
([]
byte
,
[]
byte
)
{
func
calcAllPrefix
(
name
string
)
([]
byte
,
[]
byte
)
{
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
name
)
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
name
)
state
:=
c
alcStatePrefix
([]
byte
(
execer
))
state
:=
types
.
C
alcStatePrefix
([]
byte
(
execer
))
local
:=
c
alcLocalPrefix
([]
byte
(
execer
))
local
:=
types
.
C
alcLocalPrefix
([]
byte
(
execer
))
return
state
,
local
return
state
,
local
}
}
func
calcCodeKey
(
name
string
)
[]
byte
{
func
calcCodeKey
(
name
string
)
[]
byte
{
return
append
([]
byte
(
"mavl-"
+
ptypes
.
JsX
+
"-code-"
),
[]
byte
(
name
)
...
)
return
append
([]
byte
(
"mavl-"
+
ptypes
.
JsX
+
"-code-"
),
[]
byte
(
name
)
...
)
}
}
func
calcRollbackKey
(
hash
[]
byte
)
[]
byte
{
return
append
([]
byte
(
"LODB-"
+
ptypes
.
JsX
+
"-rollback-"
),
hash
...
)
}
plugin/dapp/js/executor/query.go
View file @
23cc6e46
...
@@ -10,7 +10,7 @@ import (
...
@@ -10,7 +10,7 @@ import (
func
(
c
*
js
)
Query_Query
(
payload
*
jsproto
.
Call
)
(
types
.
Message
,
error
)
{
func
(
c
*
js
)
Query_Query
(
payload
*
jsproto
.
Call
)
(
types
.
Message
,
error
)
{
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
execer
:=
types
.
ExecName
(
"user."
+
ptypes
.
JsX
+
"."
+
payload
.
Name
)
c
.
prefix
=
c
alcLocalPrefix
([]
byte
(
execer
))
c
.
prefix
=
types
.
C
alcLocalPrefix
([]
byte
(
execer
))
jsvalue
,
err
:=
c
.
callVM
(
"query"
,
payload
,
nil
,
0
,
nil
)
jsvalue
,
err
:=
c
.
callVM
(
"query"
,
payload
,
nil
,
0
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
"query"
,
err
)
fmt
.
Println
(
"query"
,
err
)
...
...
vendor/github.com/33cn/chain33/system/dapp/coins/types/types.go
View file @
23cc6e46
...
@@ -135,12 +135,15 @@ func (c *CoinsType) RPC_Default_Process(action string, msg interface{}) (*types.
...
@@ -135,12 +135,15 @@ func (c *CoinsType) RPC_Default_Process(action string, msg interface{}) (*types.
// GetAssets return asset list
// GetAssets return asset list
func
(
c
*
CoinsType
)
GetAssets
(
tx
*
types
.
Transaction
)
([]
*
types
.
Asset
,
error
)
{
func
(
c
*
CoinsType
)
GetAssets
(
tx
*
types
.
Transaction
)
([]
*
types
.
Asset
,
error
)
{
asset
list
,
err
:=
c
.
ExecTypeBase
.
GetAssets
(
tx
)
asset
s
,
err
:=
c
.
ExecTypeBase
.
GetAssets
(
tx
)
if
err
!=
nil
||
len
(
asset
list
)
==
0
{
if
err
!=
nil
||
len
(
asset
s
)
==
0
{
return
nil
,
err
return
nil
,
err
}
}
if
asset
list
[
0
]
.
Symbol
==
""
{
if
asset
s
[
0
]
.
Symbol
==
""
{
asset
list
[
0
]
.
Symbol
=
types
.
GetCoinSymbol
()
asset
s
[
0
]
.
Symbol
=
types
.
GetCoinSymbol
()
}
}
return
assetlist
,
nil
if
assets
[
0
]
.
Symbol
==
"bty"
{
assets
[
0
]
.
Symbol
=
"BTY"
}
return
assets
,
nil
}
}
vendor/github.com/33cn/chain33/system/dapp/driver.go
View file @
23cc6e46
...
@@ -490,3 +490,27 @@ func (d *DriverBase) SetTxs(txs []*types.Transaction) {
...
@@ -490,3 +490,27 @@ func (d *DriverBase) SetTxs(txs []*types.Transaction) {
func
(
d
*
DriverBase
)
CheckReceiptExecOk
()
bool
{
func
(
d
*
DriverBase
)
CheckReceiptExecOk
()
bool
{
return
false
return
false
}
}
//AddRollbackKV add rollback kv
func
(
d
*
DriverBase
)
AddRollbackKV
(
tx
*
types
.
Transaction
,
execer
[]
byte
,
kvs
[]
*
types
.
KeyValue
)
[]
*
types
.
KeyValue
{
k
:=
types
.
CalcRollbackKey
(
types
.
GetRealExecName
(
execer
),
tx
.
Hash
())
kvc
:=
NewKVCreator
(
d
.
GetLocalDB
(),
types
.
CalcLocalPrefix
(
execer
),
k
)
kvc
.
AddListNoPrefix
(
kvs
)
kvc
.
AddRollbackKV
()
return
kvc
.
KVList
()
}
//DelRollbackKV del rollback kv when exec_del_local
func
(
d
*
DriverBase
)
DelRollbackKV
(
tx
*
types
.
Transaction
,
execer
[]
byte
)
([]
*
types
.
KeyValue
,
error
)
{
krollback
:=
types
.
CalcRollbackKey
(
types
.
GetRealExecName
(
execer
),
tx
.
Hash
())
kvc
:=
NewKVCreator
(
d
.
GetLocalDB
(),
types
.
CalcLocalPrefix
(
execer
),
krollback
)
kvs
,
err
:=
kvc
.
GetRollbackKVList
()
if
err
!=
nil
{
return
nil
,
err
}
for
_
,
kv
:=
range
kvs
{
kvc
.
AddNoPrefix
(
kv
.
Key
,
kv
.
Value
)
}
kvc
.
DelRollbackKV
()
return
kvc
.
KVList
(),
nil
}
vendor/github.com/33cn/chain33/system/dapp/driver_test.go
View file @
23cc6e46
...
@@ -122,6 +122,8 @@ func TestAllow(t *testing.T) {
...
@@ -122,6 +122,8 @@ func TestAllow(t *testing.T) {
}
}
func
TestDriverBase
(
t
*
testing
.
T
)
{
func
TestDriverBase
(
t
*
testing
.
T
)
{
dir
,
ldb
,
kvdb
:=
util
.
CreateTestDB
()
defer
util
.
CloseTestDB
(
dir
,
ldb
)
demo
:=
newdemoApp
()
.
(
*
demoApp
)
demo
:=
newdemoApp
()
.
(
*
demoApp
)
demo
.
SetExecutorType
(
nil
)
demo
.
SetExecutorType
(
nil
)
assert
.
Nil
(
t
,
demo
.
GetPayloadValue
())
assert
.
Nil
(
t
,
demo
.
GetPayloadValue
())
...
@@ -167,6 +169,42 @@ func TestDriverBase(t *testing.T) {
...
@@ -167,6 +169,42 @@ func TestDriverBase(t *testing.T) {
err
=
CheckAddress
(
"1HUiTRFvp6HvW6eacgV9EoBSgroRDiUsMs"
,
0
)
err
=
CheckAddress
(
"1HUiTRFvp6HvW6eacgV9EoBSgroRDiUsMs"
,
0
)
assert
.
NoError
(
t
,
err
)
assert
.
NoError
(
t
,
err
)
demo
.
SetLocalDB
(
kvdb
)
execer
:=
"user.p.guodun.demo"
kvs
:=
[]
*
types
.
KeyValue
{
{
Key
:
[]
byte
(
"hello"
),
Value
:
[]
byte
(
"world"
),
},
}
newkvs
:=
demo
.
AddRollbackKV
(
tx
,
[]
byte
(
execer
),
kvs
)
assert
.
Equal
(
t
,
2
,
len
(
newkvs
))
assert
.
Equal
(
t
,
string
(
newkvs
[
0
]
.
Key
),
"hello"
)
assert
.
Equal
(
t
,
string
(
newkvs
[
0
]
.
Value
),
"world"
)
assert
.
Equal
(
t
,
string
(
newkvs
[
1
]
.
Key
),
string
(
append
([]
byte
(
"LODB-demo-rollback-"
),
tx
.
Hash
()
...
)))
rollbackkvs
:=
[]
*
types
.
KeyValue
{
{
Key
:
[]
byte
(
"hello"
),
Value
:
nil
,
},
}
data
:=
types
.
Encode
(
&
types
.
LocalDBSet
{
KV
:
rollbackkvs
})
assert
.
Equal
(
t
,
string
(
newkvs
[
1
]
.
Value
),
string
(
types
.
Encode
(
&
types
.
ReceiptLog
{
Ty
:
types
.
TyLogRollback
,
Log
:
data
})))
_
,
err
=
demo
.
DelRollbackKV
(
tx
,
[]
byte
(
execer
))
assert
.
Equal
(
t
,
err
,
types
.
ErrNotFound
)
kvdb
.
Set
(
newkvs
[
1
]
.
Key
,
newkvs
[
1
]
.
Value
)
newkvs
,
err
=
demo
.
DelRollbackKV
(
tx
,
[]
byte
(
execer
))
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
2
,
len
(
newkvs
))
assert
.
Equal
(
t
,
string
(
newkvs
[
0
]
.
Key
),
"hello"
)
assert
.
Equal
(
t
,
newkvs
[
0
]
.
Value
,
[]
byte
(
nil
))
assert
.
Equal
(
t
,
string
(
newkvs
[
1
]
.
Key
),
string
(
append
([]
byte
(
"LODB-demo-rollback-"
),
tx
.
Hash
()
...
)))
assert
.
Equal
(
t
,
newkvs
[
1
]
.
Value
,
[]
byte
(
nil
))
}
}
func
TestDriverBase_Query
(
t
*
testing
.
T
)
{
func
TestDriverBase_Query
(
t
*
testing
.
T
)
{
...
...
vendor/github.com/33cn/chain33/types/key_test.go
0 → 100644
View file @
23cc6e46
package
types
import
(
"testing"
"github.com/stretchr/testify/assert"
)
func
TestKeyCreate
(
t
*
testing
.
T
)
{
assert
.
Equal
(
t
,
TotalFeeKey
([]
byte
(
"1"
)),
[]
byte
(
"TotalFeeKey:1"
))
assert
.
Equal
(
t
,
CalcLocalPrefix
([]
byte
(
"1"
)),
[]
byte
(
"LODB-1-"
))
assert
.
Equal
(
t
,
CalcStatePrefix
([]
byte
(
"1"
)),
[]
byte
(
"mavl-1-"
))
assert
.
Equal
(
t
,
CalcRollbackKey
([]
byte
(
"execer"
),
[]
byte
(
"1"
)),
[]
byte
(
"LODB-execer-rollback-1"
))
assert
.
Equal
(
t
,
StatisticFlag
(),
[]
byte
(
"Statistics:Flag"
))
}
vendor/github.com/33cn/chain33/types/localkv.go
View file @
23cc6e46
...
@@ -6,7 +6,6 @@ package types
...
@@ -6,7 +6,6 @@ package types
import
(
import
(
"fmt"
"fmt"
"time"
)
)
// 定义key值
// 定义key值
...
@@ -63,23 +62,30 @@ func StatisticFlag() []byte {
...
@@ -63,23 +62,30 @@ func StatisticFlag() []byte {
return
[]
byte
(
"Statistics:Flag"
)
return
[]
byte
(
"Statistics:Flag"
)
}
}
//StatisticTicketInfoKey 统计ticket的key
//TotalFeeKey 统计所有费用的key
func
StatisticTicketInfoKey
(
ticketID
string
)
[]
byte
{
func
TotalFeeKey
(
hash
[]
byte
)
[]
byte
{
return
[]
byte
(
"Statistics:TicketInfo:TicketId:"
+
ticketID
)
key
:=
[]
byte
(
"TotalFeeKey:"
)
return
append
(
key
,
hash
...
)
}
}
//StatisticTicketInfoOrderKey 统计ticket的key
//CalcLocalPrefix 计算localdb key
func
StatisticTicketInfoOrderKey
(
minerAddr
string
,
createTime
int64
,
ticketID
string
)
[]
byte
{
func
CalcLocalPrefix
(
execer
[]
byte
)
[]
byte
{
return
[]
byte
(
"Statistics:TicketInfoOrder:Addr:"
+
minerAddr
+
":CreateTime:"
+
time
.
Unix
(
createTime
,
0
)
.
Format
(
"20060102150405"
)
+
":TicketId:"
+
ticketID
)
s
:=
append
([]
byte
(
"LODB-"
),
execer
...
)
s
=
append
(
s
,
byte
(
'-'
))
return
s
}
}
//StatisticTicketKey 统计ticket的key
//CalcStatePrefix 计算localdb key
func
StatisticTicketKey
(
minerAddr
string
)
[]
byte
{
func
CalcStatePrefix
(
execer
[]
byte
)
[]
byte
{
return
[]
byte
(
"Statistics:TicketStat:Addr:"
+
minerAddr
)
s
:=
append
([]
byte
(
"mavl-"
),
execer
...
)
s
=
append
(
s
,
byte
(
'-'
))
return
s
}
}
//TotalFeeKey 统计所有费用的key
//CalcRollbackKey 计算回滚的key
func
TotalFeeKey
(
hash
[]
byte
)
[]
byte
{
func
CalcRollbackKey
(
execer
[]
byte
,
hash
[]
byte
)
[]
byte
{
key
:=
[]
byte
(
"TotalFeeKey:"
)
prefix
:=
CalcLocalPrefix
(
execer
)
return
append
(
key
,
hash
...
)
key
:=
append
(
prefix
,
[]
byte
(
"rollback-"
)
...
)
key
=
append
(
key
,
hash
...
)
return
key
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment