Commit 8d191ffa authored by vipwzw's avatar vipwzw

auto ci

parent 5c40e411
......@@ -78,14 +78,14 @@ func (t *tokenDB) mint(db dbm.KV, addr string, amount int64) ([]*types.KeyValue,
if t.token.Owner != addr {
return nil, nil, types.ErrNotAllow
}
if t.token.Total + amount > types.MaxTokenBalance {
if t.token.Total+amount > types.MaxTokenBalance {
return nil, nil, types.ErrAmount
}
prevToken := t.token
t.token.Total += amount
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: &t.token})}}
return kvs, logs, nil
}
......@@ -516,7 +516,7 @@ func (action *tokenAction) mint(mint *pty.TokenMint) (*types.Receipt, error) {
return nil, err
}
if tokendb.token.Category & pty.CategoryMintSupport == 0 {
if tokendb.token.Category&pty.CategoryMintSupport == 0 {
return nil, types.ErrNotSupport
}
......@@ -541,4 +541,3 @@ func (action *tokenAction) mint(mint *pty.TokenMint) (*types.Receipt, error) {
return &types.Receipt{Ty: types.ExecOk, KV: kvs, Logs: logs}, nil
}
This diff is collapsed.
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