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
adfce3ad
Commit
adfce3ad
authored
Dec 25, 2018
by
linj
Committed by
vipwzw
Dec 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix create token asset tx in main chain
parent
fc84138c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
types.go
plugin/dapp/token/types/types.go
+30
-0
No files found.
plugin/dapp/token/types/types.go
View file @
adfce3ad
...
@@ -5,11 +5,16 @@
...
@@ -5,11 +5,16 @@
package
types
package
types
import
(
import
(
"encoding/json"
"reflect"
"reflect"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
)
)
var
tokenlog
=
log
.
New
(
"module"
,
"execs.token.types"
)
func
init
()
{
func
init
()
{
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
TokenX
))
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
TokenX
))
types
.
RegistorExecutor
(
TokenX
,
NewType
())
types
.
RegistorExecutor
(
TokenX
,
NewType
())
...
@@ -92,3 +97,28 @@ func (t *TokenType) RPC_Default_Process(action string, msg interface{}) (*types.
...
@@ -92,3 +97,28 @@ func (t *TokenType) RPC_Default_Process(action string, msg interface{}) (*types.
}
}
return
tx
,
err
return
tx
,
err
}
}
func
(
t
*
TokenType
)
CreateTx
(
action
string
,
msg
json
.
RawMessage
)
(
*
types
.
Transaction
,
error
)
{
tx
,
err
:=
t
.
ExecTypeBase
.
CreateTx
(
action
,
msg
)
if
err
!=
nil
{
tokenlog
.
Error
(
"token CreateTx failed"
,
"err"
,
err
,
"action"
,
action
,
"msg"
,
string
(
msg
))
return
nil
,
err
}
if
!
types
.
IsPara
()
{
var
transfer
TokenAction
err
=
types
.
Decode
(
tx
.
Payload
,
&
transfer
)
if
err
!=
nil
{
tokenlog
.
Error
(
"token CreateTx failed"
,
"decode payload err"
,
err
,
"action"
,
action
,
"msg"
,
string
(
msg
))
return
nil
,
err
}
if
action
==
"Transfer"
{
tx
.
To
=
transfer
.
GetTransfer
()
.
To
}
else
if
action
==
"Withdraw"
{
tx
.
To
=
transfer
.
GetWithdraw
()
.
To
}
else
if
action
==
"TransferToExec"
{
tx
.
To
=
transfer
.
GetTransferToExec
()
.
To
}
}
return
tx
,
nil
}
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