From 8ab298f1c5642ba300e79c88dc86ec866877f300 Mon Sep 17 00:00:00 2001 From: Ivan Gureev Date: Sat, 8 Apr 2023 06:58:28 +0300 Subject: [PATCH] Embeded cert for go vendoring (#118) * master: Embeded cert for go vendoring * master: Embeded network ini configs for go vendoring --------- Co-authored-by: Ivan Gureev --- client/cert/embed.go | 1 + client/common/denom.go | 3 ++- client/common/embeded.go | 4 ++++ client/metadata/assets/embed.go | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 client/cert/embed.go create mode 100644 client/common/embeded.go create mode 100644 client/metadata/assets/embed.go diff --git a/client/cert/embed.go b/client/cert/embed.go new file mode 100644 index 00000000..aebdc7b6 --- /dev/null +++ b/client/cert/embed.go @@ -0,0 +1 @@ +package cert diff --git a/client/common/denom.go b/client/common/denom.go index 32523cf9..ef98285a 100644 --- a/client/common/denom.go +++ b/client/common/denom.go @@ -2,6 +2,7 @@ package common import ( "fmt" + "gopkg.in/ini.v1" ) @@ -14,7 +15,7 @@ type Denom struct { } func LoadMetadata(network Network, marketId string) Denom { - fileName := fmt.Sprintf("client/metadata/assets/%s.ini", network.Name) + fileName := getFileAbsPath(fmt.Sprintf("../metadata/assets/%s.ini", network.Name)) cfg, err := ini.Load(fileName) if err != nil { panic(err) diff --git a/client/common/embeded.go b/client/common/embeded.go new file mode 100644 index 00000000..b22554cf --- /dev/null +++ b/client/common/embeded.go @@ -0,0 +1,4 @@ +package common + +import _ "github.com/InjectiveLabs/sdk-go/client/cert" +import _ "github.com/InjectiveLabs/sdk-go/client/metadata/assets" diff --git a/client/metadata/assets/embed.go b/client/metadata/assets/embed.go new file mode 100644 index 00000000..aebdc7b6 --- /dev/null +++ b/client/metadata/assets/embed.go @@ -0,0 +1 @@ +package cert