From 0e12c0ee4e7c8371133f39f5295b272609949f26 Mon Sep 17 00:00:00 2001 From: lash Date: Mon, 30 Dec 2024 19:35:45 +0000 Subject: [PATCH 1/5] Add prefix for dumper, format base dump key for pg --- devtools/store/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devtools/store/main.go b/devtools/store/main.go index 9262703..908e321 100644 --- a/devtools/store/main.go +++ b/devtools/store/main.go @@ -11,6 +11,7 @@ import ( "git.grassecon.net/urdt/ussd/initializers" "git.grassecon.net/urdt/ussd/internal/storage" "git.grassecon.net/urdt/ussd/debug" + "git.defalsify.org/vise.git/db" "git.defalsify.org/vise.git/logging" ) @@ -47,13 +48,14 @@ func main() { store, err := menuStorageService.GetUserdataDb(ctx) if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) + fmt.Fprintf(os.Stderr, "get userdata db: %v\n", err.Error()) os.Exit(1) } + store.SetPrefix(db.DATATYPE_USERDATA) d, err := store.Dump(ctx, []byte(sessionId)) if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) + fmt.Fprintf(os.Stderr, "store dump fail: %v\n", err.Error()) os.Exit(1) } From 3bcd48e5a7849f58032251bd34ff15a0bbb1fd18 Mon Sep 17 00:00:00 2001 From: lash Date: Mon, 30 Dec 2024 19:58:34 +0000 Subject: [PATCH 2/5] Update govise --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e1b7ddb..7b7bff3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.grassecon.net/urdt/ussd go 1.23.0 require ( - git.defalsify.org/vise.git v0.2.1-0.20241212145627-683015d4df80 + git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d github.com/alecthomas/assert/v2 v2.2.2 github.com/gofrs/uuid v4.4.0+incompatible github.com/grassrootseconomics/eth-custodial v1.3.0-beta diff --git a/go.sum b/go.sum index ef7b782..d6dc755 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.defalsify.org/vise.git v0.2.1-0.20241212145627-683015d4df80 h1:GYUVXRUtMpA40T4COeAduoay6CIgXjD5cfDYZOTFIKw= -git.defalsify.org/vise.git v0.2.1-0.20241212145627-683015d4df80/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= +git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d h1:suOILWHLMQCRc5K3BuzOF8B3wRr3kvJwZFqzGthT/lM= +git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= From c7dbe1d88f4174ec1b54d71f4b23980105a96668 Mon Sep 17 00:00:00 2001 From: lash Date: Tue, 31 Dec 2024 08:30:08 +0000 Subject: [PATCH 3/5] Remove obsolete subprefix strings --- debug/db_debug.go | 4 ---- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/debug/db_debug.go b/debug/db_debug.go index ed2dd66..05a238b 100644 --- a/debug/db_debug.go +++ b/debug/db_debug.go @@ -11,13 +11,9 @@ import ( func init() { DebugCap |= 1 dbTypStr[db.DATATYPE_STATE] = "internal state" - dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_ACCOUNT] = "account" - dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_ACCOUNT_CREATED] = "account created" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_TRACKING_ID] = "tracking id" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_PUBLIC_KEY] = "public key" - dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_CUSTODIAL_ID] = "custodial id" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_ACCOUNT_PIN] = "account pin" - dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_ACCOUNT_STATUS] = "account status" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_FIRST_NAME] = "first name" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_FAMILY_NAME] = "family name" dbTypStr[db.DATATYPE_USERDATA + 1 + common.DATA_YOB] = "year of birth" diff --git a/go.mod b/go.mod index 7b7bff3..a423398 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.grassecon.net/urdt/ussd go 1.23.0 require ( - git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d + git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b github.com/alecthomas/assert/v2 v2.2.2 github.com/gofrs/uuid v4.4.0+incompatible github.com/grassrootseconomics/eth-custodial v1.3.0-beta diff --git a/go.sum b/go.sum index d6dc755..95b4843 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d h1:suOILWHLMQCRc5K3BuzOF8B3wRr3kvJwZFqzGthT/lM= -git.defalsify.org/vise.git v0.2.3-0.20241230195348-d746f4696a2d/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= +git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b h1:s3tDS07BRCyCIxH8e9eTAsf5uqYIVGmvAmwpsT5IYT0= +git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= From 7a535f796a79f39955f702ce2bfb2093f8f03d0e Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 31 Dec 2024 11:41:04 +0300 Subject: [PATCH 4/5] output the value as a string --- devtools/store/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/store/main.go b/devtools/store/main.go index 908e321..8bd4d16 100644 --- a/devtools/store/main.go +++ b/devtools/store/main.go @@ -69,7 +69,7 @@ func main() { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) } - fmt.Printf("%vValue: %v\n\n", o, v) + fmt.Printf("%vValue: %v\n\n", o, string(v)) } err = store.Close() From cd58f5ae33b4679d9c9a2a133ffdce36b72ead76 Mon Sep 17 00:00:00 2001 From: lash Date: Tue, 31 Dec 2024 08:55:25 +0000 Subject: [PATCH 5/5] Upgrade govise --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a423398..16ccdc3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.grassecon.net/urdt/ussd go 1.23.0 require ( - git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b + git.defalsify.org/vise.git v0.2.3-0.20241231085136-8582c7e157d9 github.com/alecthomas/assert/v2 v2.2.2 github.com/gofrs/uuid v4.4.0+incompatible github.com/grassrootseconomics/eth-custodial v1.3.0-beta diff --git a/go.sum b/go.sum index 95b4843..9086cd8 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b h1:s3tDS07BRCyCIxH8e9eTAsf5uqYIVGmvAmwpsT5IYT0= -git.defalsify.org/vise.git v0.2.3-0.20241231082805-35b41792f61b/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= +git.defalsify.org/vise.git v0.2.3-0.20241231085136-8582c7e157d9 h1:O3m+NgWDWtJm8OculT99c4bDMAO4xLe2c8hpCKpsd9g= +git.defalsify.org/vise.git v0.2.3-0.20241231085136-8582c7e157d9/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g=