From 7e6302c6623d75a2d5a76639c04f6d9c5cd38eaa Mon Sep 17 00:00:00 2001 From: Taka Goto Date: Thu, 4 Oct 2018 16:35:51 -0500 Subject: [PATCH] update bite to take in string for urn and ilk --- cmd/root.go | 6 +++--- pkg/transformers/bite/converter_test.go | 4 ++-- pkg/transformers/bite/entity.go | 4 ++-- pkg/transformers/bite/model.go | 4 ++-- pkg/transformers/test_data/bite.go | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 500c8be6..e4c28607 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -64,9 +64,9 @@ func database(cmd *cobra.Command, args []string) { ipc = viper.GetString("client.ipcpath") levelDbPath = viper.GetString("client.leveldbpath") databaseConfig = config.Database{ - Name: viper.GetString("database.name"), - Hostname: viper.GetString("database.hostname"), - Port: viper.GetInt("database.port"), + Name: "vulcanize_public", + Hostname: "localhost", + Port: 5432, User: viper.GetString("database.user"), Password: viper.GetString("database.password"), } diff --git a/pkg/transformers/bite/converter_test.go b/pkg/transformers/bite/converter_test.go index e33b218a..af14588d 100644 --- a/pkg/transformers/bite/converter_test.go +++ b/pkg/transformers/bite/converter_test.go @@ -79,8 +79,8 @@ var _ = Describe("Bite Converter", func() { Expect(err).NotTo(HaveOccurred()) expectedModel := bite.BiteModel{ Id: "1", - Ilk: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - Urn: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + Ilk: "", + Urn: "", Ink: "", Art: "", IArt: "", diff --git a/pkg/transformers/bite/entity.go b/pkg/transformers/bite/entity.go index aa80b81e..f088f2a2 100644 --- a/pkg/transformers/bite/entity.go +++ b/pkg/transformers/bite/entity.go @@ -21,8 +21,8 @@ import ( type BiteEntity struct { Id *big.Int - Ilk [32]byte - Urn [32]byte + Ilk string + Urn string Ink *big.Int Art *big.Int Tab *big.Int diff --git a/pkg/transformers/bite/model.go b/pkg/transformers/bite/model.go index a951eb74..678a59fe 100644 --- a/pkg/transformers/bite/model.go +++ b/pkg/transformers/bite/model.go @@ -16,8 +16,8 @@ package bite type BiteModel struct { Id string - Ilk []byte - Urn []byte + Ilk string + Urn string Ink string Art string IArt string diff --git a/pkg/transformers/test_data/bite.go b/pkg/transformers/test_data/bite.go index efdccb8e..e2af6d13 100644 --- a/pkg/transformers/test_data/bite.go +++ b/pkg/transformers/test_data/bite.go @@ -40,8 +40,8 @@ var ( biteIArt = big.NewInt(5) biteRawJson, _ = json.Marshal(EthBiteLog) biteRawString = string(biteRawJson) - biteIlk = [32]byte{102, 97, 107, 101, 32, 105, 108, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - biteLad = [32]byte{102, 97, 107, 101, 32, 108, 97, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + biteIlk = "ilk" + biteLad = "urn" biteId = int64(1) ) @@ -76,8 +76,8 @@ var BiteEntity = bite.BiteEntity{ var BiteModel = bite.BiteModel{ Id: strconv.FormatInt(biteId, 10), - Ilk: biteIlk[:], - Urn: biteLad[:], + Ilk: biteIlk, + Urn: biteLad, Ink: biteInk.String(), Art: biteArt.String(), Tab: biteTab.String(),