forked from cerc-io/ipld-eth-server
Persist Urns in raw bytes32 format
- Enables simple usage in contract storage lookups
This commit is contained in:
@@ -3,7 +3,6 @@ package vat_grab
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
@@ -20,10 +19,10 @@ func (VatGrabConverter) ToModels(ethLogs []types.Log) ([]interface{}, error) {
|
||||
return nil, err
|
||||
}
|
||||
ilk := shared.GetHexWithoutPrefix(ethLog.Topics[1].Bytes())
|
||||
urn := common.BytesToAddress(ethLog.Topics[2].Bytes())
|
||||
v := common.BytesToAddress(ethLog.Topics[3].Bytes())
|
||||
urn := shared.GetHexWithoutPrefix(ethLog.Topics[2].Bytes())
|
||||
v := shared.GetHexWithoutPrefix(ethLog.Topics[3].Bytes())
|
||||
wBytes := shared.GetDataBytesAtIndex(-3, ethLog.Data)
|
||||
w := common.BytesToAddress(wBytes)
|
||||
w := shared.GetHexWithoutPrefix(wBytes)
|
||||
dinkBytes := shared.GetDataBytesAtIndex(-2, ethLog.Data)
|
||||
dink := big.NewInt(0).SetBytes(dinkBytes).String()
|
||||
dartBytes := shared.GetDataBytesAtIndex(-1, ethLog.Data)
|
||||
@@ -35,9 +34,9 @@ func (VatGrabConverter) ToModels(ethLogs []types.Log) ([]interface{}, error) {
|
||||
}
|
||||
model := VatGrabModel{
|
||||
Ilk: ilk,
|
||||
Urn: urn.String(),
|
||||
V: v.String(),
|
||||
W: w.String(),
|
||||
Urn: urn,
|
||||
V: v,
|
||||
W: w,
|
||||
Dink: dink,
|
||||
Dart: dart,
|
||||
LogIndex: ethLog.Index,
|
||||
|
||||
Reference in New Issue
Block a user