integration test for vat flux

This commit is contained in:
Taka Goto
2018-10-17 16:25:12 -05:00
parent b38c29ce43
commit 21088eb3a2
3 changed files with 64 additions and 4 deletions
+3 -2
View File
@@ -15,6 +15,7 @@
package vat_flux
import (
"bytes"
"encoding/json"
"errors"
"github.com/ethereum/go-ethereum/common"
@@ -37,7 +38,7 @@ func (VatFluxConverter) ToModels(ethLogs []types.Log) ([]VatFluxModel, error) {
return nil, err
}
ilk := common.BytesToAddress(ethLog.Topics[1].Bytes())
ilk := string(bytes.Trim(ethLog.Topics[1].Bytes(), "\x00"))
src := common.BytesToAddress(ethLog.Topics[2].Bytes())
dst := common.BytesToAddress(ethLog.Topics[3].Bytes())
radBytes := shared.GetDataBytesAtIndex(-1, ethLog.Data)
@@ -53,7 +54,7 @@ func (VatFluxConverter) ToModels(ethLogs []types.Log) ([]VatFluxModel, error) {
}
model := VatFluxModel{
Ilk: ilk.String(),
Ilk: ilk,
Src: src.String(),
Dst: dst.String(),
Rad: rad,