Commit ec2b7e0d authored by linj's avatar linj

fmt & linter

parent c47322b3
......@@ -110,9 +110,7 @@ func (pack *TokenMintPack) checkBalance(txInfo map[string]interface{}) bool {
accCurrent := parseInt64(logAccBurn["current"].(map[string]interface{})["balance"])
accPrev := parseInt64(logAccBurn["prev"].(map[string]interface{})["balance"])
return totalCurrent - amount == totalPrev && accCurrent - amount == accPrev
return totalCurrent-amount == totalPrev && accCurrent-amount == accPrev
}
// TokenBurnCase token mint case
......@@ -162,9 +160,7 @@ func (pack *TokenBurnPack) checkBalance(txInfo map[string]interface{}) bool {
accCurrent := parseInt64(logAccBurn["current"].(map[string]interface{})["balance"])
accPrev := parseInt64(logAccBurn["prev"].(map[string]interface{})["balance"])
return totalCurrent + amount == totalPrev && accCurrent + amount == accPrev
return totalCurrent+amount == totalPrev && accCurrent+amount == accPrev
}
func parseInt64(s interface{}) int64 {
......
......@@ -539,7 +539,6 @@ func tokenBurn(cmd *cobra.Command, args []string) {
ctx.RunWithoutMarshal()
}
// GetTokenLogsCmd get logs of token
func GetTokenLogsCmd() *cobra.Command {
cmd := &cobra.Command{
......
......@@ -244,7 +244,7 @@ func (t *token) ExecLocal_TokenMint(payload *tokenty.TokenMint, tx *types.Transa
table := NewLogsTable(t.GetLocalDB())
txIndex := dapp.HeightIndexStr(t.GetHeight(), int64(index))
err = table.Add(&tokenty.LocalLogs{Symbol: payload.Symbol, TxIndex: txIndex, ActionType: tokenty.TokenActionMint, TxHash: "0x"+hex.EncodeToString(tx.Hash())})
err = table.Add(&tokenty.LocalLogs{Symbol: payload.Symbol, TxIndex: txIndex, ActionType: tokenty.TokenActionMint, TxHash: "0x" + hex.EncodeToString(tx.Hash())})
if err != nil {
return nil, err
}
......@@ -269,7 +269,7 @@ func (t *token) ExecLocal_TokenBurn(payload *tokenty.TokenBurn, tx *types.Transa
table := NewLogsTable(t.GetLocalDB())
txIndex := dapp.HeightIndexStr(t.GetHeight(), int64(index))
err = table.Add(&tokenty.LocalLogs{Symbol: payload.Symbol, TxIndex: txIndex, ActionType: tokenty.TokenActionBurn, TxHash: "0x"+hex.EncodeToString(tx.Hash())})
err = table.Add(&tokenty.LocalLogs{Symbol: payload.Symbol, TxIndex: txIndex, ActionType: tokenty.TokenActionBurn, TxHash: "0x" + hex.EncodeToString(tx.Hash())})
if err != nil {
return nil, err
}
......
......@@ -101,7 +101,6 @@ func (t *tokenDB) burn(db dbm.KV, amount int64) ([]*types.KeyValue, []*types.Rec
return kvs, logs, nil
}
func getTokenFromDB(db dbm.KV, symbol string, owner string) (*pty.Token, error) {
key := calcTokenAddrKeyS(symbol, owner)
value, err := db.Get(key)
......
......@@ -21,6 +21,7 @@ const (
TokenActionTransferToExec = 11
// TokenActionMint for token mint
TokenActionMint = 12
// TokenActionBurn for token burn
TokenActionBurn = 13
)
......@@ -77,6 +78,7 @@ const (
TyLogTokenGenesisDeposit = 322
// TyLogTokenMint log for token mint
TyLogTokenMint = 323
// TyLogTokenBurn log for token burn
TyLogTokenBurn = 324
)
......
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