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
be72abf2
Commit
be72abf2
authored
Mar 11, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename cur to current
parent
0e968f10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tokendb.go
plugin/dapp/token/executor/tokendb.go
+2
-2
token.proto
plugin/dapp/token/proto/token.proto
+2
-2
No files found.
plugin/dapp/token/executor/tokendb.go
View file @
be72abf2
...
@@ -85,7 +85,7 @@ func (t *tokenDB) mint(db dbm.KV, addr string, amount int64) ([]*types.KeyValue,
...
@@ -85,7 +85,7 @@ func (t *tokenDB) mint(db dbm.KV, addr string, amount int64) ([]*types.KeyValue,
t
.
token
.
Total
+=
amount
t
.
token
.
Total
+=
amount
kvs
:=
append
(
t
.
getKVSet
(
calcTokenKey
(
t
.
token
.
Symbol
)),
t
.
getKVSet
(
calcTokenAddrNewKeyS
(
t
.
token
.
Symbol
,
t
.
token
.
Owner
))
...
)
kvs
:=
append
(
t
.
getKVSet
(
calcTokenKey
(
t
.
token
.
Symbol
)),
t
.
getKVSet
(
calcTokenAddrNewKeyS
(
t
.
token
.
Symbol
,
t
.
token
.
Owner
))
...
)
logs
:=
[]
*
types
.
ReceiptLog
{{
Ty
:
pty
.
TyLogTokenMint
,
Log
:
types
.
Encode
(
&
pty
.
ReceiptTokenAmount
{
Prev
:
&
prevToken
,
Cur
:
&
t
.
token
})}}
logs
:=
[]
*
types
.
ReceiptLog
{{
Ty
:
pty
.
TyLogTokenMint
,
Log
:
types
.
Encode
(
&
pty
.
ReceiptTokenAmount
{
Prev
:
&
prevToken
,
Cur
rent
:
&
t
.
token
})}}
return
kvs
,
logs
,
nil
return
kvs
,
logs
,
nil
}
}
...
@@ -97,7 +97,7 @@ func (t *tokenDB) burn(db dbm.KV, amount int64) ([]*types.KeyValue, []*types.Rec
...
@@ -97,7 +97,7 @@ func (t *tokenDB) burn(db dbm.KV, amount int64) ([]*types.KeyValue, []*types.Rec
t
.
token
.
Total
-=
amount
t
.
token
.
Total
-=
amount
kvs
:=
append
(
t
.
getKVSet
(
calcTokenKey
(
t
.
token
.
Symbol
)),
t
.
getKVSet
(
calcTokenAddrNewKeyS
(
t
.
token
.
Symbol
,
t
.
token
.
Owner
))
...
)
kvs
:=
append
(
t
.
getKVSet
(
calcTokenKey
(
t
.
token
.
Symbol
)),
t
.
getKVSet
(
calcTokenAddrNewKeyS
(
t
.
token
.
Symbol
,
t
.
token
.
Owner
))
...
)
logs
:=
[]
*
types
.
ReceiptLog
{{
Ty
:
pty
.
TyLogTokenBurn
,
Log
:
types
.
Encode
(
&
pty
.
ReceiptTokenAmount
{
Prev
:
&
prevToken
,
Cur
:
&
t
.
token
})}}
logs
:=
[]
*
types
.
ReceiptLog
{{
Ty
:
pty
.
TyLogTokenBurn
,
Log
:
types
.
Encode
(
&
pty
.
ReceiptTokenAmount
{
Prev
:
&
prevToken
,
Cur
rent
:
&
t
.
token
})}}
return
kvs
,
logs
,
nil
return
kvs
,
logs
,
nil
}
}
...
...
plugin/dapp/token/proto/token.proto
View file @
be72abf2
...
@@ -73,8 +73,8 @@ message ReceiptToken {
...
@@ -73,8 +73,8 @@ message ReceiptToken {
}
}
message
ReceiptTokenAmount
{
message
ReceiptTokenAmount
{
Token
prev
=
1
;
Token
prev
=
1
;
Token
cur
=
2
;
Token
cur
rent
=
2
;
}
}
// local
// local
...
...
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