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/devtools/store/main.go b/devtools/store/main.go index 9262703..8bd4d16 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) } @@ -67,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() diff --git a/go.mod b/go.mod index e1b7ddb..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.1-0.20241212145627-683015d4df80 + 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 ef7b782..9086cd8 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.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=