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:
@@ -20,7 +20,6 @@ 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/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
@@ -63,8 +62,8 @@ func (converter BiteConverter) ToModels(entities []interface{}) ([]interface{},
|
||||
return nil, fmt.Errorf("entity of type %T, not %T", entity, BiteEntity{})
|
||||
}
|
||||
|
||||
ilk := common.Bytes2Hex(biteEntity.Ilk[:])
|
||||
urn := common.BytesToAddress(biteEntity.Urn[:]).String()
|
||||
ilk := shared.GetHexWithoutPrefix(biteEntity.Ilk[:])
|
||||
urn := shared.GetHexWithoutPrefix(biteEntity.Urn[:])
|
||||
ink := biteEntity.Ink
|
||||
art := biteEntity.Art
|
||||
iArt := biteEntity.IArt
|
||||
|
||||
@@ -71,7 +71,7 @@ var _ = Describe("Bite Converter", func() {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
expectedModel := bite.BiteModel{
|
||||
Ilk: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
Urn: "0x0000000000000000000000000000000000000000",
|
||||
Urn: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
Ink: "",
|
||||
Art: "",
|
||||
IArt: "",
|
||||
|
||||
Reference in New Issue
Block a user