diff --git a/examples b/examples index 547e22718d..ecf175ebda 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 547e22718d7a898077f43d8813d7ef3cc37fd60b +Subproject commit ecf175ebda1cbaed6b94439ad081ca0f8b51fdce diff --git a/khedra b/khedra index 23d9d733a9..9e310c9e05 160000 --- a/khedra +++ b/khedra @@ -1 +1 @@ -Subproject commit 23d9d733a97dbb8f3d5efd2cc08b7da949fbc832 +Subproject commit 9e310c9e05c341d5bd1497746b1ad460ba9879de diff --git a/sdk b/sdk index 057f726dc5..224e6a304f 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 057f726dc54a4479ebeac8f7cb1681ba4d86ca83 +Subproject commit 224e6a304f46447aac5a84e4b98d5f1ae3e6ec95 diff --git a/src/apps/chifra/go.mod b/src/apps/chifra/go.mod index 38f9ff0968..6cc2d18b33 100644 --- a/src/apps/chifra/go.mod +++ b/src/apps/chifra/go.mod @@ -18,8 +18,8 @@ require ( github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.10.0 github.com/wealdtech/go-ens/v3 v3.5.2 - golang.org/x/crypto v0.35.0 - golang.org/x/term v0.29.0 + golang.org/x/crypto v0.37.0 + golang.org/x/term v0.31.0 golang.org/x/time v0.5.0 ) @@ -79,10 +79,10 @@ require ( github.com/wealdtech/go-multicodec v1.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.36.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.1.7 // indirect diff --git a/src/apps/chifra/go.sum b/src/apps/chifra/go.sum index b907c8875f..2f561ae1d0 100644 --- a/src/apps/chifra/go.sum +++ b/src/apps/chifra/go.sum @@ -609,8 +609,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -667,8 +667,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -684,8 +684,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -735,13 +735,13 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -750,8 +750,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/src/apps/chifra/pkg/utils/download_and_store.go b/src/apps/chifra/pkg/utils/download_and_store.go new file mode 100644 index 0000000000..772ef6155f --- /dev/null +++ b/src/apps/chifra/pkg/utils/download_and_store.go @@ -0,0 +1,104 @@ +package utils + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "os" + "time" + + "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/file" +) + +// DownloadAndStoreJSON is a generic function that: +// - Downloads from the given URL if the local file is stale. +// - Stores it in the given file path. +// - Unmarshals the JSON bytes into a type T and returns a *T. +// +// T must be a Go type compatible with the JSON structure (e.g. a struct or slice). +func DownloadAndStoreJSON[T any](url, filename string, cacheTTL time.Duration) (*T, error) { + // Use your existing caching logic from "downloadAndStore" + bytes, err := downloadAndStore(url, filename, cacheTTL) + if err != nil { + var zero T + return &zero, err + } + + var result T + if err := json.Unmarshal(bytes, &result); err != nil { + return &result, err + } + return &result, nil +} + +// downloadAndStore retrieves data from the specified URL and caches it in the provided +// filename for up to `dur`. If the file already exists and is newer than `dur`, it returns +// the file's contents without making a network request. Otherwise, it fetches from the URL. +// +// If the server returns 404, the function writes an empty file to disk and returns a zero-length +// byte slice. For other non-200 status codes, it returns an error. +// +// If the response is valid JSON, it is pretty-formatted before being saved; otherwise it is +// saved as-is. The function returns the written file content as a byte slice. +func downloadAndStore(url, filename string, dur time.Duration) ([]byte, error) { + if file.FileExists(filename) { + lastModDate, err := file.GetModTime(filename) + if err != nil { + return nil, err + } + if time.Since(lastModDate) < dur { + data, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + return data, nil + } + } + + resp, err := http.Get(url) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode == http.StatusNotFound { + // If the file doesn't exist remotely, store an empty file + if err := os.WriteFile(filename, []byte{}, 0644); err != nil { + return nil, err + } + // Optionally update its mod time + _ = file.Touch(filename) + return []byte{}, nil + } else if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("received status %d %s for URL %s", + resp.StatusCode, resp.Status, url) + } + + rawData, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + var prettyData []byte + if json.Valid(rawData) { + var jsonData interface{} + if err := json.Unmarshal(rawData, &jsonData); err != nil { + return nil, err + } + prettyData, err = json.MarshalIndent(jsonData, "", " ") + if err != nil { + return nil, err + } + } else { + prettyData = rawData + } + + if err := os.WriteFile(filename, prettyData, 0644); err != nil { + return nil, err + } + + _ = file.Touch(filename) + + return prettyData, nil +} diff --git a/src/apps/chifra/pkg/utils/get_chain_list.go b/src/apps/chifra/pkg/utils/get_chain_list.go new file mode 100644 index 0000000000..4139be9420 --- /dev/null +++ b/src/apps/chifra/pkg/utils/get_chain_list.go @@ -0,0 +1,74 @@ +package utils + +import ( + "path/filepath" + "time" + + "github.com/TrueBlocks/trueblocks-core/src/apps/chifra/pkg/file" +) + +type ChainList struct { + Chains []ChainListItem `json:"chains"` + ChainsMap map[int]*ChainListItem +} + +type ChainListItem struct { + Name string `json:"name"` + Chain string `json:"chain"` + Icon string `json:"icon"` + Rpc []string `json:"rpc"` + Faucets []string `json:"faucets"` + NativeCurrency NativeCurrency `json:"nativeCurrency"` + InfoURL string `json:"infoURL"` + ShortName string `json:"shortName"` + ChainID int `json:"chainId"` + NetworkID int `json:"networkId"` + Explorers []Explorer `json:"explorers"` +} + +type NativeCurrency struct { + Name string `json:"name"` + Symbol string `json:"symbol"` + Decimals int `json:"decimals"` +} + +type Explorer struct { + Name string `json:"name"` + URL string `json:"url"` + Standard string `json:"standard"` +} + +func UpdateChainList(configPath string) (*ChainList, error) { + _ = file.EstablishFolder(configPath) + + chainURL := "https://chainid.network/chains.json" + chainsFile := filepath.Join(configPath, "chains.json") + + chainData, err := DownloadAndStoreJSON[[]ChainListItem](chainURL, chainsFile, 24*time.Hour) + if err != nil { + return nil, err + } + + var chainList ChainList + chainList.Chains = *chainData + chainList.ChainsMap = make(map[int]*ChainListItem) + + for _, chain := range chainList.Chains { + chainCopy := chain + chainList.ChainsMap[chain.ChainID] = &chainCopy + } + + return &chainList, nil +} + +func GetChainListItem(configPath string, chainId int) *ChainListItem { + if chainList, err := UpdateChainList(ResolvePath(configPath)); err != nil { + return nil + } else { + if ch, ok := chainList.ChainsMap[chainId]; !ok { + return nil + } else { + return ch + } + } +} diff --git a/src/apps/chifra/pkg/utils/ping_server.go b/src/apps/chifra/pkg/utils/ping_server.go new file mode 100644 index 0000000000..8f7e07afa5 --- /dev/null +++ b/src/apps/chifra/pkg/utils/ping_server.go @@ -0,0 +1,28 @@ +package utils + +import ( + "context" + "net/http" + "time" +) + +// PingServer sends a GET request to the provided URL and returns true if +// the server responds with a 200 status code. +func PingServer(serverUrl string) bool { + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + + req, err := http.NewRequestWithContext(ctx, "GET", serverUrl, nil) + if err != nil { + return false + } + + clientHTTP := &http.Client{} + resp, err := clientHTTP.Do(req) + if err != nil { + return false + } + defer resp.Body.Close() + + return resp.StatusCode == http.StatusOK +} diff --git a/src/apps/chifra/pkg/utils/remove_any.go b/src/apps/chifra/pkg/utils/remove_any.go new file mode 100644 index 0000000000..822220da0a --- /dev/null +++ b/src/apps/chifra/pkg/utils/remove_any.go @@ -0,0 +1,20 @@ +package utils + +import "strings" + +// RemoveAny returns a new string with all characters from string A that are present in +// string B removed. The function uses a map for efficient lookups and preserves the +// order of characters in A. +func RemoveAny(A, B string) string { + result := strings.Builder{} + toRemove := make(map[rune]struct{}) + for _, char := range B { + toRemove[char] = struct{}{} + } + for _, char := range A { + if _, exists := toRemove[char]; !exists { + result.WriteRune(char) + } + } + return result.String() +} diff --git a/src/apps/chifra/pkg/utils/remove_any_test.go b/src/apps/chifra/pkg/utils/remove_any_test.go new file mode 100644 index 0000000000..f7eea4352d --- /dev/null +++ b/src/apps/chifra/pkg/utils/remove_any_test.go @@ -0,0 +1,34 @@ +package utils + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// Testing status: reviewed + +func TestRemoveAny(t *testing.T) { + tests := []struct { + name string + A string + B string + expected string + }{ + {"Remove characters", "hello world", "lo", "he wrd"}, + {"Empty B", "hello", "", "hello"}, + {"Empty A", "", "xyz", ""}, + {"Remove all", "abc", "abc", ""}, + {"No matching characters", "hello", "xyz", "hello"}, + {"Unicode characters", "你好世界", "界", "你好世"}, + {"Duplicate characters in B", "banana", "na", "b"}, + {"Case sensitivity", "Hello", "h", "Hello"}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := RemoveAny(tt.A, tt.B) + assert.Equal(t, tt.expected, result) + }) + } +} diff --git a/src/apps/chifra/pkg/utils/resolve_path.go b/src/apps/chifra/pkg/utils/resolve_path.go new file mode 100644 index 0000000000..ed37acf6ad --- /dev/null +++ b/src/apps/chifra/pkg/utils/resolve_path.go @@ -0,0 +1,55 @@ +package utils + +import ( + "fmt" + "log" + "os" + "path/filepath" + "strings" +) + +// ResolveValidPath returns an absolute path expanded for ~, $HOME or other env variables +func ResolveValidPath(path string) (string, error) { + resolved := ResolvePath(path) + if resolved != ToValidPath(path) { + return resolved, fmt.Errorf("invalid folder: %s", path) + } + return resolved, nil +} + +// ResolvePath returns an absolute path expanded for ~, $HOME or other env variables +func ResolvePath(path string) string { + if path == "" { + return "" + } + + if strings.HasPrefix(path, "~") { + if path == "~" || strings.HasPrefix(path, "~/") { + home, err := os.UserHomeDir() + if err != nil { + log.Fatalf("failed to resolve home directory: %v", err) + } + path = filepath.Join(home, strings.TrimPrefix(path, "~")) + } else { + log.Fatalf("unsupported path format: %s", path) + } + } + + for _, part := range strings.Split(path, "/") { + if strings.HasPrefix(part, "$") { + envVar := strings.TrimPrefix(part, "$") + if os.Getenv(envVar) == "" { + log.Fatalf("path contains unset environment variable: %s", part) + } + } + } + + path = os.ExpandEnv(path) + + absolutePath, err := filepath.Abs(path) + if err != nil { + log.Fatalf("failed to resolve absolute path: %v", err) + } + + return absolutePath +} diff --git a/src/apps/chifra/pkg/utils/resolve_path_test.go b/src/apps/chifra/pkg/utils/resolve_path_test.go new file mode 100644 index 0000000000..100ab8c643 --- /dev/null +++ b/src/apps/chifra/pkg/utils/resolve_path_test.go @@ -0,0 +1,62 @@ +package utils + +import ( + "os" + "os/exec" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" +) + +// Testing status: reviewed + +func TestResolvePath_Fatals(t *testing.T) { + if os.Getenv("TEST_FATAL") == "1" { + input := os.Getenv("TEST_INPUT") + _ = ResolvePath(input) + return + } + + tests := []struct { + input string + }{ + {"~username"}, + {"$UNSET_ENV_VAR/test"}, + } + + for _, tt := range tests { + t.Run(tt.input, func(t *testing.T) { + cmd := exec.Command(os.Args[0], "-test.run=TestResolvePath_Fatals") + cmd.Env = append(os.Environ(), "TEST_FATAL=1", "TEST_INPUT="+tt.input, "UNSET_ENV_VAR=") + err := cmd.Run() + if err == nil || err.Error() != "exit status 1" { + t.Fatalf("expected Fatal to exit with status 1, got %v for input %s", err, tt.input) + } + }) + } +} + +func TestResolvePath_NonFatals(t *testing.T) { + homeDir, _ := os.UserHomeDir() + currentDir, _ := os.Getwd() + + tests := []struct { + input string + expected string + }{ + {"~", homeDir}, + {"~/test", filepath.Join(homeDir, "test")}, + {"$HOME/test", filepath.Join(homeDir, "test")}, + {"./test", filepath.Join(currentDir, "test")}, + {"/usr/local/test", "/usr/local/test"}, + {"", ""}, + } + + for _, tt := range tests { + t.Run(tt.input, func(t *testing.T) { + result := ResolvePath(tt.input) + assert.Equal(t, tt.expected, result) + }) + } +} diff --git a/src/apps/chifra/pkg/utils/strip_colors.go b/src/apps/chifra/pkg/utils/strip_colors.go new file mode 100644 index 0000000000..ec4672f716 --- /dev/null +++ b/src/apps/chifra/pkg/utils/strip_colors.go @@ -0,0 +1,8 @@ +package utils + +import "regexp" + +func StripColors(input string) string { + re := regexp.MustCompile(`\033\[[0-9;]*[mK]`) + return re.ReplaceAllString(input, "") +} diff --git a/src/apps/chifra/pkg/utils/to_valid_path.go b/src/apps/chifra/pkg/utils/to_valid_path.go new file mode 100644 index 0000000000..8549f0f70a --- /dev/null +++ b/src/apps/chifra/pkg/utils/to_valid_path.go @@ -0,0 +1,17 @@ +package utils + +import ( + "path/filepath" + "regexp" +) + +func ToValidPath(path string) string { + re := regexp.MustCompile(`[^a-zA-Z0-9_\-\.\/\\]`) + resolved := ResolvePath(path) + transformed := re.ReplaceAllString(resolved, "_") + transformed = filepath.Clean(transformed) + if len(transformed) == 0 { + return "_" + } + return transformed +} diff --git a/src/dev_tools/goMaker/go.mod b/src/dev_tools/goMaker/go.mod index 96901f0988..287ab080cd 100644 --- a/src/dev_tools/goMaker/go.mod +++ b/src/dev_tools/goMaker/go.mod @@ -4,9 +4,9 @@ module github.com/TrueBlocks/trueblocks-core/goMaker go 1.23.1 require ( - github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f + github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 github.com/gocarina/gocsv v0.0.0-20230123225133-763e25b40669 - golang.org/x/text v0.22.0 + golang.org/x/text v0.24.0 ) require ( @@ -40,10 +40,11 @@ require ( github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.35.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect google.golang.org/protobuf v1.34.2 // indirect lukechampine.com/blake3 v1.1.7 // indirect ) diff --git a/src/dev_tools/goMaker/go.sum b/src/dev_tools/goMaker/go.sum index b4d5df3077..da35606b0d 100644 --- a/src/dev_tools/goMaker/go.sum +++ b/src/dev_tools/goMaker/go.sum @@ -1,5 +1,5 @@ -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f h1:R+oNeXN/9zd4ZTWHHhPxRHSl7XFv1EirxdxDR9yQtRE= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 h1:+OVaLA5roh9VWyPSWGlO8i+Ilo48EsGdx9AvBq3jxDg= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/bykof/gostradamus v1.0.4 h1:77iq/tANg5rZSxjoZ98zepZbv3VrotijEmlnH/WycD4= @@ -89,18 +89,20 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/src/dev_tools/indexManager/go.mod b/src/dev_tools/indexManager/go.mod index d8db65ae4e..56dac98698 100644 --- a/src/dev_tools/indexManager/go.mod +++ b/src/dev_tools/indexManager/go.mod @@ -3,7 +3,7 @@ module github.com/TrueBlocks/trueblocks-core/indexManager // Go Version go 1.23.1 -require github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f +require github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 require ( github.com/bykof/gostradamus v1.0.4 // indirect @@ -12,7 +12,8 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.35.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect ) diff --git a/src/dev_tools/indexManager/go.sum b/src/dev_tools/indexManager/go.sum index 1042196f6c..29ada83a88 100644 --- a/src/dev_tools/indexManager/go.sum +++ b/src/dev_tools/indexManager/go.sum @@ -1,5 +1,5 @@ -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f h1:R+oNeXN/9zd4ZTWHHhPxRHSl7XFv1EirxdxDR9yQtRE= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 h1:+OVaLA5roh9VWyPSWGlO8i+Ilo48EsGdx9AvBq3jxDg= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= github.com/bykof/gostradamus v1.0.4 h1:77iq/tANg5rZSxjoZ98zepZbv3VrotijEmlnH/WycD4= github.com/bykof/gostradamus v1.0.4/go.mod h1:pdH0bv8yFLwr4G6EbM1j3QUb4AdCmiG7xlTjVwYyPNM= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -23,12 +23,14 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/src/dev_tools/sdkFuzzer/go.mod b/src/dev_tools/sdkFuzzer/go.mod index 20615a9d53..2a8f94b925 100644 --- a/src/dev_tools/sdkFuzzer/go.mod +++ b/src/dev_tools/sdkFuzzer/go.mod @@ -4,8 +4,8 @@ module github.com/TrueBlocks/trueblocks-core/sdkFuzzer go 1.23.1 require ( - github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f - github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0 + github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 + github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0 ) require ( @@ -64,13 +64,13 @@ require ( github.com/wealdtech/go-ens/v3 v3.5.2 // indirect github.com/wealdtech/go-multicodec v1.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.35.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.36.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.34.2 // indirect lukechampine.com/blake3 v1.1.7 // indirect diff --git a/src/dev_tools/sdkFuzzer/go.sum b/src/dev_tools/sdkFuzzer/go.sum index 8303fd5caf..37561f5be8 100644 --- a/src/dev_tools/sdkFuzzer/go.sum +++ b/src/dev_tools/sdkFuzzer/go.sum @@ -40,10 +40,10 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f h1:R+oNeXN/9zd4ZTWHHhPxRHSl7XFv1EirxdxDR9yQtRE= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= -github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0 h1:BwOgc+Mxhv+3VywfoConst5FpRKwiVgjERZ3Q7/kyzw= -github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0/go.mod h1:j4bt0SwcCvK3grVvlHSWPAPZf/IjEEXBf49/gvO/HV4= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 h1:+OVaLA5roh9VWyPSWGlO8i+Ilo48EsGdx9AvBq3jxDg= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= +github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0 h1:A0SxFT5oMEjB3vYACiNzpiuYK8++UDnEjPPm0t++pP8= +github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0/go.mod h1:eOy7kvED8pUbIR9++77GoXw5h166pzdR2gkinwp24sc= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= @@ -613,8 +613,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -671,8 +671,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -688,8 +688,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -739,13 +739,13 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -754,8 +754,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/src/dev_tools/testRunner/go.mod b/src/dev_tools/testRunner/go.mod index ddd9aec9dd..2b8670a5fc 100644 --- a/src/dev_tools/testRunner/go.mod +++ b/src/dev_tools/testRunner/go.mod @@ -4,8 +4,8 @@ module github.com/TrueBlocks/trueblocks-core/testRunner go 1.23.1 require ( - github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f - github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0 + github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 + github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0 ) require ( @@ -64,13 +64,13 @@ require ( github.com/wealdtech/go-ens/v3 v3.5.2 // indirect github.com/wealdtech/go-multicodec v1.4.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.35.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.36.0 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.34.2 // indirect lukechampine.com/blake3 v1.1.7 // indirect diff --git a/src/dev_tools/testRunner/go.sum b/src/dev_tools/testRunner/go.sum index 8303fd5caf..37561f5be8 100644 --- a/src/dev_tools/testRunner/go.sum +++ b/src/dev_tools/testRunner/go.sum @@ -40,10 +40,10 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f h1:R+oNeXN/9zd4ZTWHHhPxRHSl7XFv1EirxdxDR9yQtRE= -github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250329011249-9faa29fe970f/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= -github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0 h1:BwOgc+Mxhv+3VywfoConst5FpRKwiVgjERZ3Q7/kyzw= -github.com/TrueBlocks/trueblocks-sdk/v5 v5.0.0/go.mod h1:j4bt0SwcCvK3grVvlHSWPAPZf/IjEEXBf49/gvO/HV4= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774 h1:+OVaLA5roh9VWyPSWGlO8i+Ilo48EsGdx9AvBq3jxDg= +github.com/TrueBlocks/trueblocks-core/src/apps/chifra v0.0.0-20250414171638-e8a1233eb774/go.mod h1:eHm5w11i17E453hYlcTPI0T+UxAhiwb536yZv/8/Ehs= +github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0 h1:A0SxFT5oMEjB3vYACiNzpiuYK8++UDnEjPPm0t++pP8= +github.com/TrueBlocks/trueblocks-sdk/v5 v5.1.0/go.mod h1:eOy7kvED8pUbIR9++77GoXw5h166pzdR2gkinwp24sc= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= @@ -613,8 +613,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -671,8 +671,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -688,8 +688,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -739,13 +739,13 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -754,8 +754,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=