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
8e2b4f82
Commit
8e2b4f82
authored
Mar 08, 2019
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmt
parent
13f8bc1e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
11 deletions
+9
-11
token.go
plugin/dapp/token/commands/token.go
+2
-3
exec_local.go
plugin/dapp/token/executor/exec_local.go
+3
-2
logs.go
plugin/dapp/token/executor/logs.go
+1
-3
query.go
plugin/dapp/token/executor/query.go
+1
-1
token_new_test.go
plugin/dapp/token/executor/token_new_test.go
+1
-1
types.go
plugin/dapp/token/types/types.go
+1
-1
No files found.
plugin/dapp/token/commands/token.go
View file @
8e2b4f82
...
...
@@ -496,7 +496,7 @@ func tokenMint(cmd *cobra.Command, args []string) {
params
:=
&
tokenty
.
TokenMint
{
Symbol
:
symbol
,
Amount
:
int64
((
amount
+
0.000001
)
*
1e4
)
*
1e4
,
Amount
:
int64
((
amount
+
0.000001
)
*
1e4
)
*
1e4
,
}
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"token.CreateRawTokenMintTx"
,
params
,
nil
)
...
...
@@ -522,7 +522,7 @@ func getTokenLogs(cmd *cobra.Command, args []string) {
var
params
rpctypes
.
Query4Jrpc
params
.
Execer
=
getRealExecName
(
paraName
,
"token"
)
params
.
FuncName
=
"GetTokenHistory"
params
.
Payload
=
types
.
MustPBToJSON
(
&
types
.
ReqString
{
Data
:
symbol
})
params
.
Payload
=
types
.
MustPBToJSON
(
&
types
.
ReqString
{
Data
:
symbol
})
rpc
,
err
:=
jsonclient
.
NewJSONClient
(
rpcLaddr
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
...
...
@@ -547,4 +547,3 @@ func getTokenLogsFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"s"
,
""
,
"token symbol"
)
cmd
.
MarkFlagRequired
(
"symbol"
)
}
plugin/dapp/token/executor/exec_local.go
View file @
8e2b4f82
...
...
@@ -5,11 +5,12 @@
package
executor
import
(
"encoding/hex"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
tokenty
"github.com/33cn/plugin/plugin/dapp/token/types"
"github.com/33cn/chain33/system/dapp"
"encoding/hex"
)
func
(
t
*
token
)
ExecLocal_Transfer
(
payload
*
types
.
AssetsTransfer
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
...
...
plugin/dapp/token/executor/logs.go
View file @
8e2b4f82
...
...
@@ -14,7 +14,6 @@ import (
pty
"github.com/33cn/plugin/plugin/dapp/token/types"
)
var
opt_logs_table
=
&
table
.
Option
{
Prefix
:
"LODB-token"
,
Name
:
"logs"
,
...
...
@@ -95,4 +94,4 @@ func list(db dbm.KVDB, indexName string, data *pty.LocalLogs, count, direction i
return
nil
,
types
.
ErrNotFound
}
return
rows
,
nil
}
\ No newline at end of file
}
plugin/dapp/token/executor/query.go
View file @
8e2b4f82
...
...
@@ -75,7 +75,7 @@ func (t *token) Query_GetTokenHistory(in *types.ReqString) (types.Message, error
if
in
==
nil
{
return
nil
,
types
.
ErrInvalidParam
}
rows
,
err
:=
list
(
t
.
GetLocalDB
(),
"symbol"
,
&
tokenty
.
LocalLogs
{
Symbol
:
in
.
Data
},
-
1
,
0
)
rows
,
err
:=
list
(
t
.
GetLocalDB
(),
"symbol"
,
&
tokenty
.
LocalLogs
{
Symbol
:
in
.
Data
},
-
1
,
0
)
if
err
!=
nil
{
tokenlog
.
Error
(
"Query_GetTokenHistory"
,
"err"
,
err
)
return
nil
,
err
...
...
plugin/dapp/token/executor/token_new_test.go
View file @
8e2b4f82
...
...
@@ -357,7 +357,7 @@ func TestQueryTokenLogs(t *testing.T) {
req
.
Driver
=
execName
req
.
FuncName
=
"GetTokenHistory"
req
.
Param
=
types
.
Encode
(
&
types
.
ReqString
{
Data
:
tokenSym
})
req
.
Param
=
types
.
Encode
(
&
types
.
ReqString
{
Data
:
tokenSym
})
reply
,
err
:=
paraClient
.
QueryChain
(
context
.
Background
(),
&
req
)
if
err
!=
nil
{
...
...
plugin/dapp/token/types/types.go
View file @
8e2b4f82
...
...
@@ -57,7 +57,7 @@ func (t *TokenType) GetTypeMap() map[string]int32 {
"TokenFinishCreate"
:
TokenActionFinishCreate
,
"TokenRevokeCreate"
:
TokenActionRevokeCreate
,
"TransferToExec"
:
TokenActionTransferToExec
,
"TokenMint"
:
TokenActionMint
,
"TokenMint"
:
TokenActionMint
,
}
}
...
...
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