From 62c63d9b532cf000a17e532f366f82128e85513c Mon Sep 17 00:00:00 2001 From: Aurora Gaffney Date: Tue, 16 Jul 2024 15:56:41 -0500 Subject: [PATCH] feat: add ada-preprod profile as default --- internal/config/config.go | 2 +- internal/config/profile.go | 9 +++++++++ internal/state/state.go | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index e546f79..ff7edca 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -96,7 +96,7 @@ var globalConfig = &Config{ State: StateConfig{ Directory: "./.state", }, - Profile: "cardano-preprod-testing", + Profile: "ada-preprod", } func Load(configFile string) (*Config, error) { diff --git a/internal/config/profile.go b/internal/config/profile.go index 5a84ff7..efe7373 100644 --- a/internal/config/profile.go +++ b/internal/config/profile.go @@ -26,4 +26,13 @@ var Profiles = map[string]Profile{ InterceptSlot: 50844079, InterceptHash: "81325118471fddb00a20327572b371aee7cce13b846a18500d011b9cefd2a34c", }, + "ada-preprod": Profile{ + Network: "preprod", + Tld: "ada", + PolicyId: "32c89cdb9c73b904ae0fd230770ee082d6e5fe090b20eaa08ee70dd3", + ScriptAddress: "addr_test1xzqg5fr7v4ee3p2xehpnm44ad5hu485jnsn4f78566evl7qrdufu8hy0xgpxma2wyt4mtcwgt0td0rtx5ku0vxll3yns632tph", + // The intercept slot/hash correspond to the block before the first TX on the above address + InterceptSlot: 65308876, + InterceptHash: "435703531e57bfe9b4d309e7360efc43e04d06531c9393530c57bebf029ec634", + }, } diff --git a/internal/state/state.go b/internal/state/state.go index 3724a47..652cf6b 100644 --- a/internal/state/state.go +++ b/internal/state/state.go @@ -208,6 +208,9 @@ func (s *State) UpdateDomain( } domainRecordsSplit := strings.Split(string(domainRecordsVal), ",") for _, tmpRecordKey := range domainRecordsSplit { + if tmpRecordKey == "" { + continue + } if !slices.Contains(recordKeys, tmpRecordKey) { if err := txn.Delete([]byte(tmpRecordKey)); err != nil { return err