Commit a9b9d765 authored by linj's avatar linj

fix , add log

parent 8af8e65f
...@@ -157,6 +157,7 @@ func TestPrecreate(t *testing.T) { ...@@ -157,6 +157,7 @@ func TestPrecreate(t *testing.T) {
Total: tokenAmount, Total: tokenAmount,
Price: tokenPrice, Price: tokenPrice,
Owner: addr, Owner: addr,
Category: pty.CategoryMintSupport,
} }
precreate := &pty.TokenAction{ precreate := &pty.TokenAction{
Ty: pty.TokenActionPreCreate, Ty: pty.TokenActionPreCreate,
......
...@@ -517,12 +517,13 @@ func (action *tokenAction) mint(mint *pty.TokenMint) (*types.Receipt, error) { ...@@ -517,12 +517,13 @@ func (action *tokenAction) mint(mint *pty.TokenMint) (*types.Receipt, error) {
} }
if tokendb.token.Category&pty.CategoryMintSupport == 0 { if tokendb.token.Category&pty.CategoryMintSupport == 0 {
tokenlog.Error("Can't mint category", "category", tokendb.token.Category, "support", pty.CategoryMintSupport)
return nil, types.ErrNotSupport return nil, types.ErrNotSupport
} }
kvs, logs, err := tokendb.mint(action.db, action.fromaddr, mint.Amount) kvs, logs, err := tokendb.mint(action.db, action.fromaddr, mint.Amount)
if err != nil { if err != nil {
tokenlog.Error("token mint ", "symbol", mint.GetSymbol(), "error", err) tokenlog.Error("token mint ", "symbol", mint.GetSymbol(), "error", err, "from", action.fromaddr, "owner", tokendb.token.Owner)
return nil, err return nil, err
} }
......
...@@ -124,7 +124,7 @@ func (c *Jrpc) CreateRawTokenRevokeTx(param *tokenty.TokenRevokeCreate, result * ...@@ -124,7 +124,7 @@ func (c *Jrpc) CreateRawTokenRevokeTx(param *tokenty.TokenRevokeCreate, result *
// CreateRawTokenMintTx 创建未签名的mint Token交易 // CreateRawTokenMintTx 创建未签名的mint Token交易
func (c *Jrpc) CreateRawTokenMintTx(param *tokenty.TokenMint, result *interface{}) error { func (c *Jrpc) CreateRawTokenMintTx(param *tokenty.TokenMint, result *interface{}) error {
if param == nil || param.Symbol == "" || param.Amount > 0 { if param == nil || param.Symbol == "" || param.Amount <= 0 {
return types.ErrInvalidParam return types.ErrInvalidParam
} }
data, err := types.CallCreateTx(types.ExecName(tokenty.TokenX), "TokenMint", param) data, err := types.CallCreateTx(types.ExecName(tokenty.TokenX), "TokenMint", param)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment