Skip to content

Commit

Permalink
Add TransactionCount
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfengjin committed Aug 29, 2021
1 parent 9747c76 commit 0bfc3c0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package evm

import (
"encoding/hex"
"fmt"
"math/big"
"strconv"

Expand Down Expand Up @@ -40,7 +39,7 @@ func NewEVMProxy(manager contract.Manager) (EVMProxy, error) {
registry.RegisterKernMethod(CONTRACT_EVM, "SendRawTransaction", p.sendRawTransaction)
registry.RegisterKernMethod(CONTRACT_EVM, "GetTransactionReceipt", p.getTransactionReceipt)
registry.RegisterKernMethod(CONTRACT_EVM, "BalanceOf", p.balanceOf)
registry.RegisterKernMethod(CONTRACT_EVM, "TransactionCount", p.transactionCount)
registry.RegisterKernMethod(CONTRACT_EVM, "GetTransactionCount", p.transactionCount)
return &p, nil
}

Expand Down Expand Up @@ -225,7 +224,6 @@ func (p *proxy) transfer(ctx contract.KContext, from, to []byte, amount *big.Int
toBalance = toBalance.Add(toBalance, amount)

// 这里不能直接存 bytes, 当结果是0的时候会有大问题
fmt.Println(fromBalance.String())
if err := ctx.Put(BALANCE_PREFIX, from, []byte(fromBalance.String())); err != nil {
return err
}
Expand Down

0 comments on commit 0bfc3c0

Please sign in to comment.