support rosetta tracer

pull/4065/head
Lutty 3 years ago
parent 3657852943
commit d86ac24fc1
  1. 9
      core/state/state_object.go
  2. 2
      hmy/tracers/rosetta_block_tracer.go

@ -341,9 +341,6 @@ func (s *Object) CommitTrie(db Database) error {
// AddBalance removes amount from c's balance.
// It is used to add funds to the destination account of a transfer.
func (s *Object) AddBalance(amount *big.Int) {
if s.address.String() == "0x9aFba568f59854539D17B9120B6E4d31b9e8a3eF" {
fmt.Printf("AddBalance: %s => %s\n", s.address.String(), amount.String())
}
// EIP158: We must check emptiness for the objects such that the account
// clearing (0,0,0 objects) can take effect.
if amount.Sign() == 0 {
@ -359,9 +356,6 @@ func (s *Object) AddBalance(amount *big.Int) {
// SubBalance removes amount from c's balance.
// It is used to remove funds from the origin account of a transfer.
func (s *Object) SubBalance(amount *big.Int) {
if s.address.String() == "0x9aFba568f59854539D17B9120B6E4d31b9e8a3eF" {
fmt.Printf("SubBalance: %s\n", amount.String())
}
if amount.Sign() == 0 {
return
}
@ -370,9 +364,6 @@ func (s *Object) SubBalance(amount *big.Int) {
// SetBalance ...
func (s *Object) SetBalance(amount *big.Int) {
if s.address.String() == "0x9aFba568f59854539D17B9120B6E4d31b9e8a3eF" {
fmt.Printf("SetBalance: %s\n", amount.String())
}
s.db.journal.append(balanceChange{
account: &s.address,
prev: new(big.Int).Set(s.data.Balance),

@ -89,5 +89,5 @@ func (rbt *RosettaBlockTracer) GetResult() ([]*RosettaLogItem, error) {
finalize(subAc, root.err, append(traceAddress[:], i))
}
return results, err
return append(results, rbt.logs...), err
}

Loading…
Cancel
Save