Persist Urns in raw bytes32 format

- Enables simple usage in contract storage lookups
This commit is contained in:
Rob Mulholand
2019-02-08 11:41:17 -06:00
parent 0a024d429d
commit 09abcb841a
37 changed files with 99 additions and 106 deletions
+3 -3
View File
@@ -20,8 +20,8 @@ import (
"encoding/json"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"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/geth"
)
@@ -64,8 +64,8 @@ func (FrobConverter) ToModels(entities []interface{}) ([]interface{}, error) {
return nil, err
}
model := FrobModel{
Ilk: common.Bytes2Hex(frobEntity.Ilk[:]),
Urn: common.BytesToAddress(frobEntity.Urn[:]).String(),
Ilk: shared.GetHexWithoutPrefix(frobEntity.Ilk[:]),
Urn: shared.GetHexWithoutPrefix(frobEntity.Urn[:]),
Ink: frobEntity.Ink.String(),
Art: frobEntity.Art.String(),
Dink: frobEntity.Dink.String(),