From 4559b92c364b57592eecec540218b31c11d669db Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 15:52:26 +0200 Subject: [PATCH 01/12] docs(logic): improve predicates documentation --- x/logic/predicate/address.go | 23 +++++++++++++---------- x/logic/predicate/bank.go | 34 ++++++++++++++++++++-------------- x/logic/predicate/block.go | 15 +++++++++++---- x/logic/predicate/chain.go | 5 ++++- x/logic/predicate/crypto.go | 22 +++++++++++++--------- x/logic/predicate/did.go | 23 +++++++++++++---------- x/logic/predicate/file.go | 28 ++++++++++++++++++++++++---- x/logic/predicate/json.go | 14 ++++++++------ x/logic/predicate/string.go | 33 ++++++++++++++------------------- x/logic/predicate/uri.go | 23 +++++++++++++++++++++++ 10 files changed, 143 insertions(+), 77 deletions(-) diff --git a/x/logic/predicate/address.go b/x/logic/predicate/address.go index b19d305f..5aadd24a 100644 --- a/x/logic/predicate/address.go +++ b/x/logic/predicate/address.go @@ -11,28 +11,31 @@ import ( "github.com/okp4/okp4d/x/logic/util" ) -// Bech32Address is a predicate that convert a bech32 encoded string into base64 bytes and give the address prefix, or -// convert a prefix (HRP) and base64 encoded bytes to bech32 encoded string. The signature is as follows: +// Bech32Address is a predicate that convert a [bech32] encoded string into [base64] bytes and give the address prefix, +// or convert a prefix (HRP) and [base64] encoded bytes to [bech32] encoded string. +// +// The signature is as follows: // // bech32_address(-Address, +Bech32) // bech32_address(+Address, -Bech32) // bech32_address(+Address, +Bech32) // // where: -// - Address is a pair of, HRP (Human-Readable Part) containing the address prefix and the list of integers -// between 0 and 255 (byte) that represent the base64 encoded bech32 address string. Represented like this : -(HRP, Address) +// - Address is a pair of the HRP (Human-Readable Part) which holds the address prefix and a list of integers +// ranging from 0 to 255 that represent the base64 encoded bech32 address string. // - Bech32 is an Atom or string representing the bech32 encoded string address // // # Example: // -// - Convert the given bech32 address into base64 encoded byte by unify the prefix of given address (Hrp) and -// the base64 encoded value (Address). -// -// bech32_address(-(Hrp, Address), 'okp415wn30a9z4uc692s0kkx5fp5d4qfr3ac7sj9dqn'). +// # Convert the given bech32 address into base64 encoded byte by unify the prefix of given address (Hrp) and the +// base64 encoded value (Address). +// - bech32_address(-(Hrp, Address), 'okp415wn30a9z4uc692s0kkx5fp5d4qfr3ac7sj9dqn'). // -// - Convert the given pair of HRP and base64 encoded address byte by unify the Bech32 string encoded value. +// # Convert the given pair of HRP and base64 encoded address byte by unify the Bech32 string encoded value. +// - bech32_address(-('okp4', [163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]), Bech32). // -// bech32_address(-('okp4', [163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]), Bech32). +// [bech32]: https://docs.cosmos.network/main/build/spec/addresses/bech32#hrp-table +// [base64]: https://fr.wikipedia.org/wiki/Base64 func Bech32Address(vm *engine.VM, address, bech32 engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return engine.Delay(func(ctx context.Context) *engine.Promise { switch b := env.Resolve(bech32).(type) { diff --git a/x/logic/predicate/bank.go b/x/logic/predicate/bank.go index add25589..6245da2f 100644 --- a/x/logic/predicate/bank.go +++ b/x/logic/predicate/bank.go @@ -14,22 +14,24 @@ import ( // BankBalances is a predicate which unifies the given terms with the list of balances (coins) of the given account. // +// The signature is as follows: +// // bank_balances(?Account, ?Balances) // // where: // - Account represents the account address (in Bech32 format). // - Balances represents the balances of the account as a list of pairs of coin denomination and amount. // -// Example: +// Examples: // // # Query the balances of the account. // - bank_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). // -// # Query the balances of all accounts. The result is a list of pairs of account address and balances. -// - bank_balances(X, Y). +// # Query the balances of all accounts. The result is a list of pairs of account address and balances. +// - bank_balances(X, Y). // -// # Query the first balance of the given account by unifying the denomination and amount with the given terms. -// - bank_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +// # Query the first balance of the given account by unifying the denomination and amount with the given terms. +// - bank_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). func BankBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return fetchBalances("bank_balances/2", account, @@ -47,6 +49,8 @@ func BankBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont // BankSpendableBalances is a predicate which unifies the given terms with the list of spendable coins of the given account. // +// The signature is as follows: +// // bank_spendable_balances(?Account, ?Balances) // // where: @@ -58,11 +62,11 @@ func BankBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont // # Query the spendable balances of the account. // - bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). // -// # Query the spendable balances of all accounts. The result is a list of pairs of account address and balances. -// - bank_spendable_balances(X, Y). +// # Query the spendable balances of all accounts. The result is a list of pairs of account address and balances. +// - bank_spendable_balances(X, Y). // -// # Query the first spendable balances of the given account by unifying the denomination and amount with the given terms. -// - bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +// # Query the first spendable balances of the given account by unifying the denomination and amount with the given terms. +// - bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). func BankSpendableBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return fetchBalances("bank_spendable_balances/2", account, @@ -77,22 +81,24 @@ func BankSpendableBalances(vm *engine.VM, account, balances engine.Term, cont en // BankLockedBalances is a predicate which unifies the given terms with the list of locked coins of the given account. // +// The signature is as follows: +// // bank_locked_balances(?Account, ?Balances) // // where: // - Account represents the account address (in Bech32 format). // - Balances represents the locked balances of the account as a list of pairs of coin denomination and amount. // -// Example: +// Examples: // // # Query the locked coins of the account. // - bank_locked_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). // -// # Query the locked balances of all accounts. The result is a list of pairs of account address and balances. -// - bank_locked_balances(X, Y). +// # Query the locked balances of all accounts. The result is a list of pairs of account address and balances. +// - bank_locked_balances(X, Y). // -// # Query the first locked balances of the given account by unifying the denomination and amount with the given terms. -// - bank_locked_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +// # Query the first locked balances of the given account by unifying the denomination and amount with the given terms. +// - bank_locked_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). func BankLockedBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return fetchBalances("bank_locked_balances/2", account, diff --git a/x/logic/predicate/block.go b/x/logic/predicate/block.go index beb7b136..dad9f981 100644 --- a/x/logic/predicate/block.go +++ b/x/logic/predicate/block.go @@ -9,11 +9,15 @@ import ( "github.com/okp4/okp4d/x/logic/util" ) -// BlockHeight is a predicate which unifies the given term with the current block height. The signature is: +// BlockHeight is a predicate which unifies the given term with the current block height. +// +// The signature is as follows: // // block_height(?Height) // -// where Height represents the current chain height at the time of the query. +// where: +// +// - Height represents the current chain height at the time of the query. // // Example: // @@ -30,11 +34,14 @@ func BlockHeight(vm *engine.VM, height engine.Term, cont engine.Cont, env *engin }) } -// BlockTime is a predicate which unifies the given term with the current block time. The signature is: +// BlockTime is a predicate which unifies the given term with the current block time. +// +// The signature is as follows: // // block_time(?Time) // -// where Time represents the current chain time at the time of the query. +// where: +// - Time represents the current chain time at the time of the query. // // Example: // diff --git a/x/logic/predicate/chain.go b/x/logic/predicate/chain.go index c597d369..702069ee 100644 --- a/x/logic/predicate/chain.go +++ b/x/logic/predicate/chain.go @@ -11,9 +11,12 @@ import ( // ChainID is a predicate which unifies the given term with the current chain ID. The signature is: // +// The signature is as follows: +// // chain_id(?ChainID) // -// where ChainID represents the current chain ID at the time of the query. +// where: +// - ChainID represents the current chain ID at the time of the query. // // Example: // diff --git a/x/logic/predicate/crypto.go b/x/logic/predicate/crypto.go index 0064f9d3..02b26681 100644 --- a/x/logic/predicate/crypto.go +++ b/x/logic/predicate/crypto.go @@ -12,14 +12,16 @@ import ( "github.com/okp4/okp4d/x/logic/util" ) -// SHAHash is a predicate that computes the Hash of the given Data. The signature is as follow: +// SHAHash is a predicate that computes the Hash of the given Data. +// +// The signature is as follows: // // sha_hash(+Data, -Hash) is det // sha_hash(+Data, +Hash) is det // // Where: -// - Data represents the data to be hashed with the SHA-256 algorithm. -// - Hash is the variable that will contain Hashed value of Data. +// - Data represents the data to be hashed with the SHA-256 algorithm. +// - Hash is the variable that will contain Hashed value of Data. // // Note: Due to the principles of the hash algorithm (pre-image resistance), this predicate can only compute the hash // value from input data, and cannot compute the original input data from the hash value. @@ -41,18 +43,20 @@ func SHAHash(vm *engine.VM, data, hash engine.Term, cont engine.Cont, env *engin }) } -// HexBytes is a predicate that unifies hexadecimal encoded bytes to a list of bytes. The signature is as follow: +// HexBytes is a predicate that unifies hexadecimal encoded bytes to a list of bytes. +// +// The signature is as follows: // -// hex_bytes(?Hex, ?Bytes) is det +// hex_bytes(?Hex, ?Bytes) is det // // Where: -// - Hex is an Atom, string or list of characters in hexadecimal encoding. -// - Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. +// - Hex is an Atom, string or list of characters in hexadecimal encoding. +// - Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. // // Example: // -// # Convert hexadecimal atom to list of bytes. -// - hex_bytes('2c26b46b68ffc68ff99b453c1d3041341342d706483bfa0f98a5e886266e7ae', Bytes). +// # Convert hexadecimal atom to list of bytes. +// - hex_bytes('2c26b46b68ffc68ff99b453c1d3041341342d706483bfa0f98a5e886266e7ae', Bytes). func HexBytes(vm *engine.VM, hexa, bts engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return engine.Delay(func(ctx context.Context) *engine.Promise { var result []byte diff --git a/x/logic/predicate/did.go b/x/logic/predicate/did.go index 40fef84c..0a9a8260 100644 --- a/x/logic/predicate/did.go +++ b/x/logic/predicate/did.go @@ -16,22 +16,25 @@ var AtomDID = engine.NewAtom("did") // DIDComponents is a predicate which breaks down a DID into its components according to the [W3C DID] specification. // -// did_components(+DID, -Components) is det -// did_components(-DID, +Components) is det +// The signature is as follows: +// +// did_components(+DID, -Components) is det +// did_components(-DID, +Components) is det // // where: -// - `DID` represents the DID URI as a `text`, compliant with the [W3C DID] specification. -// - `Components` is a term `did(Method, ID, Path, Query, Fragment)` following the [DID syntax] which represents -// respectively the method name, the method-specific ID, the path, the query, and the fragment of the DID, in decoded -// form. Components that are not found (i.e. `null`) are left uninstantiated (variable). +// - DID represents DID URI, given as an Atom, compliant with [W3C DID] specification. +// - Components is a compound Term in the format did(Method, ID, Path, Query, Fragment), aligned with the [DID syntax], +// where: Method is The method name, ID is The method-specific identifier, Path is the path component, Query is the +// query component and Fragment is The fragment component. +// For any component not present, its value will be null and thus will be left as an uninstantiated variable. // // Example: // -// # Decompose a DID into its components. -// - did_components('did:example:123456?versionId=1', did(Method, ID, Path, Query, Fragment)). +// # Decompose a DID into its components. +// - did_components('did:example:123456?versionId=1', did(Method, ID, Path, Query, Fragment)). // -// # Reconstruct a DID from its components. -// - did_components(DID, did('example', '123456', null, 'versionId=1', _42)). +// # Reconstruct a DID from its components. +// - did_components(DID, did('example', '123456', null, 'versionId=1', _42)). // // [W3C DID]: https://w3c.github.io/did-core // [DID syntax]: https://w3c.github.io/did-core/#did-syntax diff --git a/x/logic/predicate/file.go b/x/logic/predicate/file.go index a6222264..8804dbc0 100644 --- a/x/logic/predicate/file.go +++ b/x/logic/predicate/file.go @@ -10,11 +10,14 @@ import ( "github.com/ichiban/prolog/engine" ) -// SourceFile is a predicate that unify the given term with the currently loaded source file. The signature is as follows: +// SourceFile is a predicate that unify the given term with the currently loaded source file. // -// source_file(?File). +// The signature is as follows: // -// Where File represents a loaded source file. +// source_file(?File). +// +// Where: +// - File represents a loaded source file. // // Example: // @@ -84,7 +87,24 @@ func (m ioMode) Term() engine.Term { }[m] } -// Open opens SourceSink in mode and unifies with stream. +// Open is a predicate that unify a stream with a source sink on a virtual file system. +// +// The signature is as follows: +// +// open(+SourceSink, +Mode, ?Stream, +Options) +// +// Where: +// - SourceSink is an atom representing the source or sink of the stream. The atom typically represents a resource +// that can be opened, such as a URI. The URI scheme determines the type of resource that is opened. +// - Mode is an atom representing the mode of the stream (read, write, append). +// - Stream is the stream to be opened. +// - Options is a list of options. +// +// Example: +// +// # Open a stream from a cosmwasm query. +// # The Stream should be read as a string with a read_string/3 predicate, and then closed with the close/1 predicate. +// - open('cosmwasm:okp4-objectarium:okp41lppz4x9dtmccek2m6cezjlwwzup6pdqrkvxjpk95806c3dewgrfq602kgx?query=%7B%22object_data%22%3A%7B%22id%22%3A%222625337e6025495a87cb32eb7f5a042f31e4385fd7e34c90d661bfc94dd539e3%22%7D%7D', 'read', Stream) func Open(vm *engine.VM, sourceSink, mode, stream, options engine.Term, k engine.Cont, env *engine.Env) *engine.Promise { var name string switch s := env.Resolve(sourceSink).(type) { diff --git a/x/logic/predicate/json.go b/x/logic/predicate/json.go index de00066c..ed26c546 100644 --- a/x/logic/predicate/json.go +++ b/x/logic/predicate/json.go @@ -19,18 +19,20 @@ import ( // JSONProlog is a predicate that will unify a JSON string into prolog terms and vice versa. // -// json_prolog(?Json, ?Term) is det +// The signature is as follows: // -// Where -// - `Json` is the string representation of the json -// - `Term` is an Atom that would be unified by the JSON representation as Prolog terms. +// json_prolog(?Json, ?Term) is det +// +// Where: +// - Json is the string representation of the json +// - Term is an Atom that would be unified by the JSON representation as Prolog terms. // // In addition, when passing Json and Term, this predicate return true if both result match. // // Example: // -// # JSON conversion to Prolog. -// - json_prolog('{"foo": "bar"}', json([foo-bar])). +// # JSON conversion to Prolog. +// - json_prolog('{"foo": "bar"}', json([foo-bar])). func JSONProlog(vm *engine.VM, j, term engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return engine.Delay(func(ctx context.Context) *engine.Promise { var result engine.Term diff --git a/x/logic/predicate/string.go b/x/logic/predicate/string.go index a89b8849..6f9602fe 100644 --- a/x/logic/predicate/string.go +++ b/x/logic/predicate/string.go @@ -12,39 +12,34 @@ import ( "github.com/okp4/okp4d/x/logic/util" ) -// ReadString is a predicate that will read a given Stream and unify it to String. -// Optionally give a max length of reading, when stream reach the given length, the reading is stop. -// If Length is unbound, Stream is read to the end and Length is unified with the number of characters read. +// ReadString is a predicate that reads characters from the provided Stream and unifies them with String. +// Users can optionally specify a maximum length for reading; if the stream reaches this length, the reading stops. +// If Length remains unbound, the entire Stream is read, and upon completion, Length is unified with the count of characters read. // -// read_string(+Stream, ?Length, -String) is det +// The signature is as follows: // -// Where -// - `Stream`: represent a stream -// - `Length`: is the max length to read -// - `String`: represent the unified read stream as string +// read_string(+Stream, ?Length, -String) is det +// +// Where: +// - Stream is the input stream to read from. +// - Length is the optional maximum number of characters to read from the Stream. If unbound, denotes the full length of Stream. +// - String is the resultant string after reading from the Stream. // // Example: // -// # Given a file `foo.txt` that contains `Hello World`: -// ``` -// file_to_string(File, String, Length) :- +// # Given a file `foo.txt` that contains `Hello World`: +// +// file_to_string(File, String, Length) :- // // open(File, read, In), // read_string(In, Length, String), // close(Stream). // -// ``` -// -// Result : -// -// ``` -// +// # It gives: // ?- file_to_string('path/file/foo.txt', String, Length). // // String = 'Hello World' // Length = 11 -// -// ```. func ReadString(vm *engine.VM, stream, length, result engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return engine.Delay(func(ctx context.Context) *engine.Promise { var s *engine.Stream diff --git a/x/logic/predicate/uri.go b/x/logic/predicate/uri.go index 94c5905d..71024c20 100644 --- a/x/logic/predicate/uri.go +++ b/x/logic/predicate/uri.go @@ -131,6 +131,29 @@ func (comp Component) Unescape(v string) (string, error) { return url.PathUnescape(v) } +// URIEncoded is a predicate that unifies the given URI component with the given encoded or decoded string. +// +// The signature is as follows: +// +// uri_encoded(+Component, +Decoded, -Encoded) +// +// Where: +// - Component represents the component of the URI to be escaped. It can be the atom query, fragment, path or +// segment. +// - Decoded represents the decoded string to be escaped. +// - Encoded represents the encoded string. +// +// For more information on URI encoding, refer to [RFC 3986]. +// +// Example: +// +// # Escape the given string to be used in the path component. +// - uri_encoded(path, "foo/bar", Encoded). +// +// # Unescape the given string to be used in the path component. +// - uri_encoded(path, Decoded, foo%2Fbar). +// +// [RFC 3986]: https://datatracker.ietf.org/doc/html/rfc3986#section-2.1 func URIEncoded(vm *engine.VM, component, decoded, encoded engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise { return engine.Delay(func(ctx context.Context) *engine.Promise { var comp Component From 3c2841c631475f517e25c404293a2ad714a7b3f7 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 15:53:32 +0200 Subject: [PATCH 02/12] build(scripts): implement predicate documentation generation --- scripts/generate_predicates_doc.go | 99 ++++++++++++++++++++++++++++++ scripts/templates/doc.gotxt | 12 ++++ scripts/templates/func.gotxt | 16 +++++ scripts/templates/list.gotxt | 16 +++++ scripts/templates/package.gotxt | 11 ++++ scripts/templates/text.gotxt | 11 ++++ 6 files changed, 165 insertions(+) create mode 100644 scripts/generate_predicates_doc.go create mode 100644 scripts/templates/doc.gotxt create mode 100644 scripts/templates/func.gotxt create mode 100644 scripts/templates/list.gotxt create mode 100644 scripts/templates/package.gotxt create mode 100644 scripts/templates/text.gotxt diff --git a/scripts/generate_predicates_doc.go b/scripts/generate_predicates_doc.go new file mode 100644 index 00000000..709030eb --- /dev/null +++ b/scripts/generate_predicates_doc.go @@ -0,0 +1,99 @@ +package main + +import ( + "bufio" + "embed" + "fmt" + "go/build" + "os" + "path" + "strings" + + "github.com/Masterminds/sprig/v3" + "github.com/princjef/gomarkdoc" + "github.com/princjef/gomarkdoc/format" + "github.com/princjef/gomarkdoc/lang" + "github.com/princjef/gomarkdoc/logger" +) + +//go:embed templates/*.gotxt +var f embed.FS + +func GeneratePredicateDocumentation() error { + // Create a renderer to output data + out, err := gomarkdoc.NewRenderer( + gomarkdoc.WithTemplateOverride("text", readTemplateMust("text.gotxt")), + gomarkdoc.WithTemplateOverride("doc", readTemplateMust("doc.gotxt")), + gomarkdoc.WithTemplateOverride("list", readTemplateMust("list.gotxt")), + gomarkdoc.WithTemplateOverride("import", ""), + gomarkdoc.WithTemplateOverride("package", readTemplateMust("package.gotxt")), + gomarkdoc.WithTemplateOverride("file", ""), + gomarkdoc.WithTemplateOverride("func", readTemplateMust("func.gotxt")), + gomarkdoc.WithTemplateOverride("index", ""), + gomarkdoc.WithTemplateFunc("snakecase", sprig.TxtFuncMap()["snakecase"]), + gomarkdoc.WithTemplateFunc("hasSuffix", sprig.TxtFuncMap()["hasSuffix"]), + gomarkdoc.WithTemplateFunc("countSubstr", func(substr string, s string) int { + return strings.Count(s, substr) + }), + gomarkdoc.WithTemplateFunc("dict", sprig.TxtFuncMap()["dict"]), + gomarkdoc.WithFormat(&format.GitHubFlavoredMarkdown{}), + ) + if err != nil { + return err + } + + wd, err := os.Getwd() + if err != nil { + return err + } + + buildPkg, err := build.ImportDir(path.Join(wd, "x", "logic", "predicate"), build.ImportComment) + if err != nil { + return err + } + + log := logger.New(logger.DebugLevel) + pkg, err := lang.NewPackageFromBuild(log, buildPkg) + if err != nil { + return err + } + content, err := out.Package(pkg) + if err != nil { + return err + } + + if err := writeToFile("docs/predicate/predicates.md", content); err != nil { + return err + } + + return nil +} + +func readTemplateMust(templateName string) string { + template, err := f.ReadFile("templates/" + templateName) + + if err != nil { + panic(fmt.Errorf("failed to read file %s: %s", templateName, err)) + } + + return string(template) +} + +func writeToFile(filePath string, content string) error { + file, err := os.Create(filePath) + if err != nil { + return fmt.Errorf("failed to create file %s: %w", filePath, err) + } + defer file.Close() + + w := bufio.NewWriter(file) + if _, err = w.WriteString(content); err != nil { + return fmt.Errorf("failed to write to file %s: %w", filePath, err) + } + + if err = w.Flush(); err != nil { + return fmt.Errorf("failed to flush writer: %w", err) + } + + return nil +} diff --git a/scripts/templates/doc.gotxt b/scripts/templates/doc.gotxt new file mode 100644 index 00000000..57b82a76 --- /dev/null +++ b/scripts/templates/doc.gotxt @@ -0,0 +1,12 @@ +{{- range (iter .Blocks) -}} + {{- if eq .Entry.Kind "paragraph" -}} + {{- template "text" .Entry.Spans -}} + {{- else if eq .Entry.Kind "code" -}} + {{- codeBlock "text" (include "text" .Entry.Spans) -}} + {{- else if eq .Entry.Kind "header" -}} + {{- header .Entry.Level (include "text" .Entry.Spans) -}} + {{- else if eq .Entry.Kind "list" -}} + {{- template "list" .Entry.List -}} + {{- end -}} + {{- if (not .Last) -}}{{- spacer -}}{{- end -}} +{{- end -}} diff --git a/scripts/templates/func.gotxt b/scripts/templates/func.gotxt new file mode 100644 index 00000000..cbc01aa5 --- /dev/null +++ b/scripts/templates/func.gotxt @@ -0,0 +1,16 @@ +{{- $name := snakecase .Name -}} +{{ $arity := add (countSubstr "," .Signature) -2 }} + +## {{ $name -}}/{{- $arity -}} +{{- spacer -}} + +{{- template "doc" .Doc -}} + +{{- if len .Examples -}} + {{- spacer -}} + + {{- range (iter .Examples) -}} + {{- template "example" .Entry -}} + {{- if (not .Last) -}}{{- spacer -}}{{- end -}} + {{- end -}} +{{- end -}} diff --git a/scripts/templates/list.gotxt b/scripts/templates/list.gotxt new file mode 100644 index 00000000..9c0442f3 --- /dev/null +++ b/scripts/templates/list.gotxt @@ -0,0 +1,16 @@ +{{- range (iter .Items) -}} +{{- if eq .Entry.Kind "ordered" -}} +{{- .Entry.Number -}}. {{ hangingIndent (include "doc" .Entry) 2 -}} +{{- else -}} +- {{ hangingIndent (include "doc" .Entry) 2 -}} +{{- end -}} + +{{- if (not .Last) -}} +{{- if $.BlankBetween -}} +{{- spacer -}} +{{- else -}} +{{- inlineSpacer -}} +{{- end -}} +{{- end -}} + +{{- end -}} diff --git a/scripts/templates/package.gotxt b/scripts/templates/package.gotxt new file mode 100644 index 00000000..3c17adad --- /dev/null +++ b/scripts/templates/package.gotxt @@ -0,0 +1,11 @@ +# Predicates documentation + +{{- if len .Funcs -}} + {{- spacer -}} + {{- range (iter .Funcs) -}} + {{ if and (not .Entry.Receiver) (hasSuffix "*engine.Promise" .Entry.Signature) }} + {{- template "func" .Entry -}} + {{- if (not .Last) -}}{{- spacer -}}{{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} diff --git a/scripts/templates/text.gotxt b/scripts/templates/text.gotxt new file mode 100644 index 00000000..1b93a197 --- /dev/null +++ b/scripts/templates/text.gotxt @@ -0,0 +1,11 @@ +{{- range . -}} + {{- if eq .Kind "text" -}} + {{- escape .Text -}} + {{- else if eq .Kind "rawText" -}} + {{- .Text -}} + {{- else if eq .Kind "autolink" -}} + {{- .Text -}} + {{- else if eq .Kind "link" -}} + {{- link (escape .Text) .URL -}} + {{- end -}} +{{- end -}} From 12a2aba15b0b6e140a874e7844fecffbfe54b571 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 15:54:24 +0200 Subject: [PATCH 03/12] build(scripts): refactor script CLI --- scripts/generate_command_doc.go | 31 ++++------------- scripts/generate_predicates_doc.go | 1 - scripts/main.go | 55 ++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 26 deletions(-) create mode 100644 scripts/main.go diff --git a/scripts/generate_command_doc.go b/scripts/generate_command_doc.go index 962ad82f..948777b9 100644 --- a/scripts/generate_command_doc.go +++ b/scripts/generate_command_doc.go @@ -1,45 +1,26 @@ package main import ( - "errors" - "log" "os" "github.com/spf13/cobra/doc" - "github.com/cosmos/cosmos-sdk/server" - "github.com/okp4/okp4d/cmd/okp4d/cmd" ) -func main() { - err := generateDocumentation("command") - if err != nil { - log.Printf("failed to generate documentation: %s\n", err) - - var codeErr *server.ErrorCode - switch { - case errors.As(err, &codeErr): - os.Exit(codeErr.Code) - default: - os.Exit(1) - } +func GenerateCommandDocumentation() error { + if err := os.Setenv("DAEMON_NAME", "okp4d"); err != nil { + return err } -} -func generateDocumentation(folder string) error { + targetPath := "docs/command" rootCmd, _ := cmd.NewRootCmd() rootCmd.DisableAutoGenTag = true - err := os.Mkdir(folder, 0o750) + err := os.Mkdir(targetPath, 0o750) if err != nil && !os.IsExist(err) { return err } - err = doc.GenMarkdownTree(rootCmd, "command") - if err != nil { - return err - } - - return nil + return doc.GenMarkdownTree(rootCmd, targetPath) } diff --git a/scripts/generate_predicates_doc.go b/scripts/generate_predicates_doc.go index 709030eb..d9091860 100644 --- a/scripts/generate_predicates_doc.go +++ b/scripts/generate_predicates_doc.go @@ -20,7 +20,6 @@ import ( var f embed.FS func GeneratePredicateDocumentation() error { - // Create a renderer to output data out, err := gomarkdoc.NewRenderer( gomarkdoc.WithTemplateOverride("text", readTemplateMust("text.gotxt")), gomarkdoc.WithTemplateOverride("doc", readTemplateMust("doc.gotxt")), diff --git a/scripts/main.go b/scripts/main.go new file mode 100644 index 00000000..b55ddd04 --- /dev/null +++ b/scripts/main.go @@ -0,0 +1,55 @@ +package main + +import ( + "errors" + "os" + + "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" +) + +func main() { + rootCmd := &cobra.Command{ + Use: "gendoc", + Short: "Simple CLI to generate documentation for the project", + PersistentPreRun: func(cmd *cobra.Command, args []string) { + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + }, + } + + rootCmd.AddCommand(generateCommandDocumentationCommand()) + rootCmd.AddCommand(generatePredicateDocumentationCommand()) + + if err := rootCmd.Execute(); err != nil { + var codeErr *server.ErrorCode + switch { + case errors.As(err, &codeErr): + os.Exit(codeErr.Code) + default: + os.Exit(1) + } + } +} + +func generateCommandDocumentationCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "command", + Short: "Generate command documentation", + RunE: func(cmd *cobra.Command, args []string) error { + return GenerateCommandDocumentation() + }, + } + return cmd +} + +func generatePredicateDocumentationCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "predicate", + Short: "Generate predicate documentation", + RunE: func(cmd *cobra.Command, args []string) error { + return GeneratePredicateDocumentation() + }, + } + return cmd +} From 98aaf9f0f5248a06ec177bc96825dad8e9924dcc Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 15:54:52 +0200 Subject: [PATCH 04/12] docs(predicate): generate documentation for predicates --- docs/predicate/predicates.md | 384 +++++++++++++++++++++++++++++++++++ x/logic/predicate/address.go | 2 +- x/logic/predicate/bank.go | 2 +- x/logic/predicate/block.go | 4 +- x/logic/predicate/chain.go | 2 +- x/logic/predicate/crypto.go | 4 +- x/logic/predicate/did.go | 2 +- x/logic/predicate/file.go | 4 +- x/logic/predicate/json.go | 2 +- x/logic/predicate/string.go | 2 +- x/logic/predicate/uri.go | 2 +- 11 files changed, 397 insertions(+), 13 deletions(-) create mode 100644 docs/predicate/predicates.md diff --git a/docs/predicate/predicates.md b/docs/predicate/predicates.md new file mode 100644 index 00000000..3ea2aae9 --- /dev/null +++ b/docs/predicate/predicates.md @@ -0,0 +1,384 @@ +# Predicates documentation + +## bank_balances/2 + +BankBalances is a predicate which unifies the given terms with the list of balances \(coins\) of the given account. + +The signature is as follows: + +```text +bank_balances(?Account, ?Balances) +``` + +where: + +- Account represents the account address \(in Bech32 format\). +- Balances represents the balances of the account as a list of pairs of coin denomination and amount. + +Examples: + +```text +# Query the balances of the account. +- bank_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). + +# Query the balances of all accounts. The result is a list of pairs of account address and balances. +- bank_balances(X, Y). + +# Query the first balance of the given account by unifying the denomination and amount with the given terms. +- bank_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +``` + +## bank_locked_balances/2 + +BankLockedBalances is a predicate which unifies the given terms with the list of locked coins of the given account. + +The signature is as follows: + +```text +bank_locked_balances(?Account, ?Balances) +``` + +where: + +- Account represents the account address \(in Bech32 format\). +- Balances represents the locked balances of the account as a list of pairs of coin denomination and amount. + +Examples: + +```text +# Query the locked coins of the account. +- bank_locked_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). + +# Query the locked balances of all accounts. The result is a list of pairs of account address and balances. +- bank_locked_balances(X, Y). + +# Query the first locked balances of the given account by unifying the denomination and amount with the given terms. +- bank_locked_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +``` + +## bank_spendable_balances/2 + +BankSpendableBalances is a predicate which unifies the given terms with the list of spendable coins of the given account. + +The signature is as follows: + +```text +bank_spendable_balances(?Account, ?Balances) +``` + +where: + +- Account represents the account address \(in Bech32 format\). +- Balances represents the spendable balances of the account as a list of pairs of coin denomination and amount. + +Examples: + +```text +# Query the spendable balances of the account. +- bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). + +# Query the spendable balances of all accounts. The result is a list of pairs of account address and balances. +- bank_spendable_balances(X, Y). + +# Query the first spendable balances of the given account by unifying the denomination and amount with the given terms. +- bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', [-(D, A), _]). +``` + +## bech32_address/2 + +Bech32Address is a predicate that convert a [bech32]() encoded string into [base64]() bytes and give the address prefix, or convert a prefix \(HRP\) and [base64]() encoded bytes to [bech32]() encoded string. + +The signature is as follows: + +```text +bech32_address(-Address, +Bech32) +bech32_address(+Address, -Bech32) +bech32_address(+Address, +Bech32) +``` + +where: + +- Address is a pair of the HRP \(Human\-Readable Part\) which holds the address prefix and a list of integers ranging from 0 to 255 that represent the base64 encoded bech32 address string. +- Bech32 is an Atom or string representing the bech32 encoded string address + +Examples: + +```text +# Convert the given bech32 address into base64 encoded byte by unify the prefix of given address (Hrp) and the +base64 encoded value (Address). +- bech32_address(-(Hrp, Address), 'okp415wn30a9z4uc692s0kkx5fp5d4qfr3ac7sj9dqn'). + +# Convert the given pair of HRP and base64 encoded address byte by unify the Bech32 string encoded value. +- bech32_address(-('okp4', [163,167,23,244,162,175,49,162,170,15,181,141,68,134,141,168,18,56,247,30]), Bech32). +``` + +## block_height/1 + +BlockHeight is a predicate which unifies the given term with the current block height. + +The signature is as follows: + +```text +block_height(?Height) +``` + +where: + +- Height represents the current chain height at the time of the query. + +Examples: + +```text +# Query the current block height. +- block_height(Height). +``` + +## block_time/1 + +BlockTime is a predicate which unifies the given term with the current block time. + +The signature is as follows: + +```text +block_time(?Time) +``` + +where: + +- Time represents the current chain time at the time of the query. + +Examples: + +```text +# Query the current block time. +- block_time(Time). +``` + +## chain_id/1 + +ChainID is a predicate which unifies the given term with the current chain ID. The signature is: + +The signature is as follows: + +```text +chain_id(?ChainID) +``` + +where: + +- ChainID represents the current chain ID at the time of the query. + +Examples: + +```text +# Query the current chain ID. +- chain_id(ChainID). +``` + +## did_components/2 + +DIDComponents is a predicate which breaks down a DID into its components according to the [W3C DID]() specification. + +The signature is as follows: + +```text +did_components(+DID, -Components) is det +did_components(-DID, +Components) is det +``` + +where: + +- DID represents DID URI, given as an Atom, compliant with [W3C DID]() specification. +- Components is a compound Term in the format did\(Method, ID, Path, Query, Fragment\), aligned with the [DID syntax](), where: Method is The method name, ID is The method\-specific identifier, Path is the path component, Query is the query component and Fragment is The fragment component. For any component not present, its value will be null and thus will be left as an uninstantiated variable. + +Examples: + +```text +# Decompose a DID into its components. +- did_components('did:example:123456?versionId=1', did(Method, ID, Path, Query, Fragment)). + +# Reconstruct a DID from its components. +- did_components(DID, did('example', '123456', null, 'versionId=1', _42)). +``` + +## hex_bytes/2 + +HexBytes is a predicate that unifies hexadecimal encoded bytes to a list of bytes. + +The signature is as follows: + +```text +hex_bytes(?Hex, ?Bytes) is det +``` + +Where: + +- Hex is an Atom, string or list of characters in hexadecimal encoding. +- Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. + +Examples: + +```text +# Convert hexadecimal atom to list of bytes. +- hex_bytes('2c26b46b68ffc68ff99b453c1d3041341342d706483bfa0f98a5e886266e7ae', Bytes). +``` + +## json_prolog/2 + +JSONProlog is a predicate that will unify a JSON string into prolog terms and vice versa. + +The signature is as follows: + +```text +json_prolog(?Json, ?Term) is det +``` + +Where: + +- Json is the string representation of the json +- Term is an Atom that would be unified by the JSON representation as Prolog terms. + +In addition, when passing Json and Term, this predicate return true if both result match. + +Examples: + +```text +# JSON conversion to Prolog. +- json_prolog('{"foo": "bar"}', json([foo-bar])). +``` + +## open/4 + +Open is a predicate that unify a stream with a source sink on a virtual file system. + +The signature is as follows: + +```text +open(+SourceSink, +Mode, ?Stream, +Options) +``` + +Where: + +- SourceSink is an atom representing the source or sink of the stream. The atom typically represents a resource that can be opened, such as a URI. The URI scheme determines the type of resource that is opened. +- Mode is an atom representing the mode of the stream \(read, write, append\). +- Stream is the stream to be opened. +- Options is a list of options. + +Examples: + +```text +# Open a stream from a cosmwasm query. +# The Stream should be read as a string with a read_string/3 predicate, and then closed with the close/1 predicate. +- open('cosmwasm:okp4-objectarium:okp412kgx?query=%7B%22object_data%22%3A%7B%...4dd539e3%22%7D%7D', 'read', Stream) +``` + +## read_string/3 + +ReadString is a predicate that reads characters from the provided Stream and unifies them with String. Users can optionally specify a maximum length for reading; if the stream reaches this length, the reading stops. If Length remains unbound, the entire Stream is read, and upon completion, Length is unified with the count of characters read. + +The signature is as follows: + +```text +read_string(+Stream, ?Length, -String) is det +``` + +Where: + +- Stream is the input stream to read from. +- Length is the optional maximum number of characters to read from the Stream. If unbound, denotes the full length of Stream. +- String is the resultant string after reading from the Stream. + +Examples: + +```text +# Given a file `foo.txt` that contains `Hello World`: + +file_to_string(File, String, Length) :- + +open(File, read, In), +read_string(In, Length, String), +close(Stream). + +# It gives: +?- file_to_string('path/file/foo.txt', String, Length). + +String = 'Hello World' +Length = 11 +``` + +## sha_hash/2 + +SHAHash is a predicate that computes the Hash of the given Data. + +The signature is as follows: + +```text +sha_hash(+Data, -Hash) is det +sha_hash(+Data, +Hash) is det +``` + +Where: + +- Data represents the data to be hashed with the SHA\-256 algorithm. +- Hash is the variable that will contain Hashed value of Data. + +Note: Due to the principles of the hash algorithm \(pre\-image resistance\), this predicate can only compute the hash value from input data, and cannot compute the original input data from the hash value. + +Examples: + +```text +# Compute the hash of the given data and unify it with the given Hash. +- sha_hash("Hello OKP4", Hash). +``` + +## source_file/1 + +SourceFile is a predicate that unify the given term with the currently loaded source file. + +The signature is as follows: + +```text +source_file(?File). +``` + +Where: + +- File represents a loaded source file. + +Examples: + +```text +# Query all the loaded source files, in alphanumeric order. +- source_file(File). + +# Query the given source file is loaded. +- source_file('foo.pl'). +``` + +## uri_encoded/3 + +URIEncoded is a predicate that unifies the given URI component with the given encoded or decoded string. + +The signature is as follows: + +```text +uri_encoded(+Component, +Decoded, -Encoded) +``` + +Where: + +- Component represents the component of the URI to be escaped. It can be the atom query, fragment, path or segment. +- Decoded represents the decoded string to be escaped. +- Encoded represents the encoded string. + +For more information on URI encoding, refer to [RFC 3986](). + +Examples: + +```text +# Escape the given string to be used in the path component. +- uri_encoded(path, "foo/bar", Encoded). + +# Unescape the given string to be used in the path component. +- uri_encoded(path, Decoded, foo%2Fbar). +``` diff --git a/x/logic/predicate/address.go b/x/logic/predicate/address.go index 5aadd24a..0fb7b39b 100644 --- a/x/logic/predicate/address.go +++ b/x/logic/predicate/address.go @@ -25,7 +25,7 @@ import ( // ranging from 0 to 255 that represent the base64 encoded bech32 address string. // - Bech32 is an Atom or string representing the bech32 encoded string address // -// # Example: +// Examples: // // # Convert the given bech32 address into base64 encoded byte by unify the prefix of given address (Hrp) and the // base64 encoded value (Address). diff --git a/x/logic/predicate/bank.go b/x/logic/predicate/bank.go index 6245da2f..adacee1b 100644 --- a/x/logic/predicate/bank.go +++ b/x/logic/predicate/bank.go @@ -57,7 +57,7 @@ func BankBalances(vm *engine.VM, account, balances engine.Term, cont engine.Cont // - Account represents the account address (in Bech32 format). // - Balances represents the spendable balances of the account as a list of pairs of coin denomination and amount. // -// Example: +// Examples: // // # Query the spendable balances of the account. // - bank_spendable_balances('okp41ffd5wx65l407yvm478cxzlgygw07h79sq0m3fm', X). diff --git a/x/logic/predicate/block.go b/x/logic/predicate/block.go index dad9f981..d51d9c31 100644 --- a/x/logic/predicate/block.go +++ b/x/logic/predicate/block.go @@ -19,7 +19,7 @@ import ( // // - Height represents the current chain height at the time of the query. // -// Example: +// Examples: // // # Query the current block height. // - block_height(Height). @@ -43,7 +43,7 @@ func BlockHeight(vm *engine.VM, height engine.Term, cont engine.Cont, env *engin // where: // - Time represents the current chain time at the time of the query. // -// Example: +// Examples: // // # Query the current block time. // - block_time(Time). diff --git a/x/logic/predicate/chain.go b/x/logic/predicate/chain.go index 702069ee..a5b34977 100644 --- a/x/logic/predicate/chain.go +++ b/x/logic/predicate/chain.go @@ -18,7 +18,7 @@ import ( // where: // - ChainID represents the current chain ID at the time of the query. // -// Example: +// Examples: // // # Query the current chain ID. // - chain_id(ChainID). diff --git a/x/logic/predicate/crypto.go b/x/logic/predicate/crypto.go index 02b26681..0f9bfa3c 100644 --- a/x/logic/predicate/crypto.go +++ b/x/logic/predicate/crypto.go @@ -26,7 +26,7 @@ import ( // Note: Due to the principles of the hash algorithm (pre-image resistance), this predicate can only compute the hash // value from input data, and cannot compute the original input data from the hash value. // -// Example: +// Examples: // // # Compute the hash of the given data and unify it with the given Hash. // - sha_hash("Hello OKP4", Hash). @@ -53,7 +53,7 @@ func SHAHash(vm *engine.VM, data, hash engine.Term, cont engine.Cont, env *engin // - Hex is an Atom, string or list of characters in hexadecimal encoding. // - Bytes is the list of numbers between 0 and 255 that represent the sequence of bytes. // -// Example: +// Examples: // // # Convert hexadecimal atom to list of bytes. // - hex_bytes('2c26b46b68ffc68ff99b453c1d3041341342d706483bfa0f98a5e886266e7ae', Bytes). diff --git a/x/logic/predicate/did.go b/x/logic/predicate/did.go index 0a9a8260..933859c4 100644 --- a/x/logic/predicate/did.go +++ b/x/logic/predicate/did.go @@ -28,7 +28,7 @@ var AtomDID = engine.NewAtom("did") // query component and Fragment is The fragment component. // For any component not present, its value will be null and thus will be left as an uninstantiated variable. // -// Example: +// Examples: // // # Decompose a DID into its components. // - did_components('did:example:123456?versionId=1', did(Method, ID, Path, Query, Fragment)). diff --git a/x/logic/predicate/file.go b/x/logic/predicate/file.go index 8804dbc0..dddece46 100644 --- a/x/logic/predicate/file.go +++ b/x/logic/predicate/file.go @@ -19,7 +19,7 @@ import ( // Where: // - File represents a loaded source file. // -// Example: +// Examples: // // # Query all the loaded source files, in alphanumeric order. // - source_file(File). @@ -100,7 +100,7 @@ func (m ioMode) Term() engine.Term { // - Stream is the stream to be opened. // - Options is a list of options. // -// Example: +// Examples: // // # Open a stream from a cosmwasm query. // # The Stream should be read as a string with a read_string/3 predicate, and then closed with the close/1 predicate. diff --git a/x/logic/predicate/json.go b/x/logic/predicate/json.go index ed26c546..dc024e73 100644 --- a/x/logic/predicate/json.go +++ b/x/logic/predicate/json.go @@ -29,7 +29,7 @@ import ( // // In addition, when passing Json and Term, this predicate return true if both result match. // -// Example: +// Examples: // // # JSON conversion to Prolog. // - json_prolog('{"foo": "bar"}', json([foo-bar])). diff --git a/x/logic/predicate/string.go b/x/logic/predicate/string.go index 6f9602fe..41356b63 100644 --- a/x/logic/predicate/string.go +++ b/x/logic/predicate/string.go @@ -25,7 +25,7 @@ import ( // - Length is the optional maximum number of characters to read from the Stream. If unbound, denotes the full length of Stream. // - String is the resultant string after reading from the Stream. // -// Example: +// Examples: // // # Given a file `foo.txt` that contains `Hello World`: // diff --git a/x/logic/predicate/uri.go b/x/logic/predicate/uri.go index 71024c20..e992f8a1 100644 --- a/x/logic/predicate/uri.go +++ b/x/logic/predicate/uri.go @@ -145,7 +145,7 @@ func (comp Component) Unescape(v string) (string, error) { // // For more information on URI encoding, refer to [RFC 3986]. // -// Example: +// Examples: // // # Escape the given string to be used in the path component. // - uri_encoded(path, "foo/bar", Encoded). From 69950ae6959876f896067169d58caf7dd62642b0 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 16:01:38 +0200 Subject: [PATCH 05/12] docs(command): re-generate command documentation --- .../okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/command/okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md b/docs/command/okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md index ce4d26e0..a99d2a2d 100644 --- a/docs/command/okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md +++ b/docs/command/okp4d_tx_gov_submit-legacy-proposal_software-upgrade.md @@ -19,7 +19,7 @@ okp4d tx gov submit-legacy-proposal software-upgrade [name] (--upgrade-height [h --aux Generate aux signer data instead of sending a tx -b, --broadcast-mode string Transaction broadcasting mode (sync|async) (default "sync") --chain-id string The network chain ID (default "okp4d") - --daemon-name string The name of the executable being upgraded (for upgrade-info validation). Default is the DAEMON_NAME env var if set, or else this executable (default "generate_command_doc") + --daemon-name string The name of the executable being upgraded (for upgrade-info validation). Default is the DAEMON_NAME env var if set, or else this executable (default "okp4d") --deposit string deposit of proposal --description string description of proposal --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) From 748bff9fcd18b6865ff48a8d2b738bb354797d0c Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 16:02:14 +0200 Subject: [PATCH 06/12] build(project): add doc-predicate target --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 105cbab9..cf12d42a 100644 --- a/Makefile +++ b/Makefile @@ -350,7 +350,7 @@ proto-gen: proto-build ## Generate all the code from the Protobuf files ## Documentation: .PHONY: doc -doc: doc-proto doc-command ## Generate all the documentation +doc: doc-proto doc-command doc-predicate ## Generate all the documentation .PHONY: doc-proto doc-proto: proto-gen ## Generate the documentation from the Protobuf files @@ -381,12 +381,10 @@ doc-proto: proto-gen ## Generate the documentation from the Protobuf files .PHONY: doc-command doc-command: ## Generate markdown documentation for the command @echo "${COLOR_CYAN} 📖 Generate markdown documentation for the command${COLOR_RESET}" - @cd docs; \ - OUT_FOLDER="command"; \ + @OUT_FOLDER="docs/command"; \ rm -rf $$OUT_FOLDER; \ - go version; \ go get ./scripts; \ - go run ../scripts/generate_command_doc.go; \ + go run ./scripts/. command; \ sed -i $(SED_FLAG) 's/(default \"\/.*\/\.okp4d\")/(default \"\/home\/john\/\.okp4d\")/g' $$OUT_FOLDER/*.md; \ sed -i $(SED_FLAG) 's/node\ name\ (default\ \".*\")/node\ name\ (default\ \"my-machine\")/g' $$OUT_FOLDER/*.md; \ sed -i $(SED_FLAG) 's/IP\ (default\ \".*\")/IP\ (default\ \"127.0.0.1\")/g' $$OUT_FOLDER/*.md; \ @@ -395,7 +393,21 @@ doc-command: ## Generate markdown documentation for the command docker run --rm \ -v `pwd`:/usr/src/docs \ -w /usr/src/docs \ - ${DOCKER_IMAGE_MARKDOWNLINT} -f $$OUT_FOLDER + ${DOCKER_IMAGE_MARKDOWNLINT} -f $$OUT_FOLDER -c docs/.markdownlint.yaml + +.PHONY: doc-predicate +doc-predicate: ## Generate markdown documentation for all the predicates (module logic) + @echo "${COLOR_CYAN} 📖 Generate markdown documentation for the predicates${COLOR_RESET}" + @OUT_FOLDER="docs/predicate"; \ + rm -rf $$OUT_FOLDER; \ + mkdir -p $$OUT_FOLDER; \ + go get ./scripts; \ + go run ./scripts/. predicate; \ + docker run --rm \ + -v `pwd`:/usr/src/docs \ + -w /usr/src/docs \ + ${DOCKER_IMAGE_MARKDOWNLINT} -f $$OUT_FOLDER -c docs/.markdownlint.yaml + ## Mock: .PHONY: mock From 272e568417b8aec5cf91deba04986ba7475547b8 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 16:15:28 +0200 Subject: [PATCH 07/12] build(deps): add dependencies for scripts --- go.mod | 36 ++++++++++++++++ go.sum | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) diff --git a/go.mod b/go.mod index 0feeaec8..b6f05623 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.1 github.com/CosmWasm/wasmd v0.40.2 + github.com/Masterminds/sprig/v3 v3.2.3 github.com/armon/go-metrics v0.4.1 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 @@ -20,6 +21,7 @@ require ( github.com/ichiban/prolog v1.1.0 github.com/ignite/cli v0.27.1 github.com/nuts-foundation/go-did v0.4.0 + github.com/princjef/gomarkdoc v1.1.0 github.com/prometheus/client_golang v1.15.0 github.com/samber/lo v1.38.1 github.com/smartystreets/goconvey v1.8.1 @@ -61,6 +63,12 @@ require ( github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/CosmWasm/wasmvm v1.2.4 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect + github.com/VividCortex/ewma v1.2.0 // indirect + github.com/acomagu/bufpipe v1.0.4 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect @@ -69,7 +77,9 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cheggaaa/pb/v3 v3.0.8 // indirect github.com/chzyer/readline v1.5.1 // indirect + github.com/cloudflare/circl v1.3.3 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.9.0 // indirect @@ -92,8 +102,13 @@ require ( github.com/docker/distribution v2.8.2+incompatible // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-git/gcfg v1.5.0 // indirect + github.com/go-git/go-billy/v5 v5.4.1 // indirect + github.com/go-git/go-git/v5 v5.6.1 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect @@ -128,11 +143,15 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/huandu/xstrings v1.3.3 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.16.5 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.0 // indirect @@ -147,29 +166,40 @@ require ( github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/ockam-network/did v0.1.4-0.20210103172416-02ae01ce06d8 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/princjef/mageutil v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/cors v1.9.0 // indirect github.com/rs/zerolog v1.29.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sergi/go-diff v1.3.1 // indirect github.com/shengdoushi/base58 v1.0.0 // indirect + github.com/shopspring/decimal v1.2.0 // indirect + github.com/sirupsen/logrus v1.9.2 // indirect + github.com/skeema/knownhosts v1.1.1 // indirect github.com/smarty/assertions v1.15.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -179,24 +209,30 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.9.0 // indirect golang.org/x/exp v0.0.0-20230519143937-03e91628a987 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.9.1 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + mvdan.cc/xurls/v2 v2.2.0 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v0.5.5 // indirect ) diff --git a/go.sum b/go.sum index 1d6f425f..8e4d28f7 100644 --- a/go.sum +++ b/go.sum @@ -232,6 +232,14 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -239,13 +247,21 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 h1:ZK3C5DtzV2nVAQTx5S5jQvMeDqWtD1By5mOoyY/xJek= +github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903/go.mod h1:8TI4H3IbrackdNgv+92dI+rhpCaLqM0IfpgCgenFvRE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= +github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= +github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= +github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -260,6 +276,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -270,6 +287,7 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -344,6 +362,10 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/cheggaaa/pb v2.0.7+incompatible/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw= +github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA= +github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= @@ -360,6 +382,9 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -490,6 +515,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -503,7 +530,11 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -527,9 +558,18 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= +github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= +github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= +github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= +github.com/go-git/go-git/v5 v5.6.1/go.mod h1:mvyoL6Unz0PiTQrGQfSfiLFhBH1c1e84ylC2MDs4ee8= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -785,6 +825,8 @@ github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3 github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -794,6 +836,10 @@ github.com/ichiban/prolog v1.1.0 h1:WAY8lg3qA2UKMySYSDFjArmKI/LuaEZV43ZQWlLGRMQ= github.com/ichiban/prolog v1.1.0/go.mod h1:RmvNfGaSktvEVZ7nmpn0gkWa5u0Y3zQcK0G+Pl+ul+s= github.com/ignite/cli v0.27.1 h1:CNMY0XIMICzfMqZ6yZC4qQNP/r3Ar0Ssh86u84HV1so= github.com/ignite/cli v0.27.1/go.mod h1:7uaYQQ07tyOBiVAlRYAcZk2g/Y1vtgU0J09oPNntR4E= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -812,9 +858,12 @@ github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bS github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -844,6 +893,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -911,9 +962,12 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -924,6 +978,8 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -933,12 +989,18 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= +github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -946,6 +1008,8 @@ github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjK github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -961,6 +1025,9 @@ github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1048,6 +1115,8 @@ github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7c github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1059,6 +1128,10 @@ github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUI github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/princjef/gomarkdoc v1.1.0 h1:xtl7mESKQWVuGiFdd1AO3dFA6OenWG86bZu97IqBNPE= +github.com/princjef/gomarkdoc v1.1.0/go.mod h1:HI3w0Zv8H03ecak/IqVAcPFTuPt7sn7Top6xbgCs1Qk= +github.com/princjef/mageutil v1.0.0 h1:1OfZcJUMsooPqieOz2ooLjI+uHUo618pdaJsbCXcFjQ= +github.com/princjef/mageutil v1.0.0/go.mod h1:mkShhaUomCYfAoVvTKRcbAs8YSVPdtezI5j6K+VXhrs= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -1102,10 +1175,15 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -1131,9 +1209,14 @@ github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KR github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1141,6 +1224,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/skeema/knownhosts v1.1.0/go.mod h1:sKFq3RD6/TKZkSWn8boUbDC7Qkgcv+8XXijpFO6roag= +github.com/skeema/knownhosts v1.1.1 h1:MTk78x9FPgDFVFkDLTrsnnfCJl7g1C/nnKvePgrIngE= +github.com/skeema/knownhosts v1.1.1/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo= github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY= github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1156,6 +1242,7 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -1230,6 +1317,10 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= +github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1295,8 +1386,15 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1342,6 +1440,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1407,11 +1507,15 @@ golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1455,6 +1559,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -1481,8 +1586,10 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1523,6 +1630,7 @@ golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1539,6 +1647,7 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1556,12 +1665,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1570,9 +1683,12 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1588,6 +1704,7 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1661,6 +1778,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1911,26 +2030,34 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/VividCortex/ewma.v1 v1.1.1/go.mod h1:TekXuFipeiHWiAlO1+wSS23vTcyFau5u3rxXUSXj710= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v2 v2.0.7/go.mod h1:0CiZ1p8pvtxBlQpLXkHuUTpdJ1shm3OqCF1QugkjHL4= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mattn/go-colorable.v0 v0.1.0/go.mod h1:BVJlBXzARQxdi3nZo6f6bnl5yR20/tOL6p+V0KejgSY= +gopkg.in/mattn/go-isatty.v0 v0.0.4/go.mod h1:wt691ab7g0X4ilKZNmMII3egK0bTxl37fEn/Fwbd8gc= +gopkg.in/mattn/go-runewidth.v0 v0.0.4/go.mod h1:BmXejnxvhwdaATwiJbB1vZ2dtXkQKZGu9yLFCZb4msQ= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1944,6 +2071,7 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= @@ -1958,6 +2086,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A= +mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= From 9a9fe7771ae332d7ea7bfd5556fc9207093b8781 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 16:17:12 +0200 Subject: [PATCH 08/12] style: make linter happy again --- scripts/generate_predicates_doc.go | 9 ++------- scripts/main.go | 3 ++- starship/tests/setup_test.go | 4 ++-- starship/tests/suite.go | 13 +++++++------ x/logic/migrations/v2/types/genesis.pb.go | 6 ++++-- x/logic/migrations/v2/types/params.pb.go | 9 ++++++--- x/logic/migrations/v2/types/query.pb.go | 12 +++++++----- x/logic/migrations/v2/types/tx.pb.go | 3 ++- x/logic/migrations/v2/types/types.pb.go | 6 ++++-- x/logic/predicate/file.go | 2 +- x/logic/testutil/expected_keepers_mocks.go | 3 ++- x/mint/testutil/expected_keepers_mocks.go | 4 +++- x/vesting/testutil/expected_keepers_mocks.go | 3 ++- 13 files changed, 44 insertions(+), 33 deletions(-) diff --git a/scripts/generate_predicates_doc.go b/scripts/generate_predicates_doc.go index d9091860..8a963413 100644 --- a/scripts/generate_predicates_doc.go +++ b/scripts/generate_predicates_doc.go @@ -61,18 +61,13 @@ func GeneratePredicateDocumentation() error { return err } - if err := writeToFile("docs/predicate/predicates.md", content); err != nil { - return err - } - - return nil + return writeToFile("docs/predicate/predicates.md", content) } func readTemplateMust(templateName string) string { template, err := f.ReadFile("templates/" + templateName) - if err != nil { - panic(fmt.Errorf("failed to read file %s: %s", templateName, err)) + panic(fmt.Errorf("failed to read file %s: %w", templateName, err)) } return string(template) diff --git a/scripts/main.go b/scripts/main.go index b55ddd04..a076b038 100644 --- a/scripts/main.go +++ b/scripts/main.go @@ -4,8 +4,9 @@ import ( "errors" "os" - "github.com/cosmos/cosmos-sdk/server" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/server" ) func main() { diff --git a/starship/tests/setup_test.go b/starship/tests/setup_test.go index af11880c..ba2f5aee 100644 --- a/starship/tests/setup_test.go +++ b/starship/tests/setup_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) func TestE2ETestSuite(t *testing.T) { diff --git a/starship/tests/suite.go b/starship/tests/suite.go index 43480226..c2897187 100644 --- a/starship/tests/suite.go +++ b/starship/tests/suite.go @@ -8,17 +8,18 @@ import ( "os" "time" - "github.com/cosmos/cosmos-sdk/types/module" - starship "github.com/cosmology-tech/starship/clients/go/client" - sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" lens "github.com/strangelove-ventures/lens/client" "github.com/stretchr/testify/suite" "go.uber.org/zap" "gopkg.in/yaml.v3" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ) var configFile = "../configs/devnet.yaml" diff --git a/x/logic/migrations/v2/types/genesis.pb.go b/x/logic/migrations/v2/types/genesis.pb.go index 0d9645ee..1a5d6c74 100644 --- a/x/logic/migrations/v2/types/genesis.pb.go +++ b/x/logic/migrations/v2/types/genesis.pb.go @@ -5,11 +5,13 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/cosmos/gogoproto/proto" + + _ "github.com/cosmos/gogoproto/gogoproto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/logic/migrations/v2/types/params.pb.go b/x/logic/migrations/v2/types/params.pb.go index 57ba347e..dd0d7799 100644 --- a/x/logic/migrations/v2/types/params.pb.go +++ b/x/logic/migrations/v2/types/params.pb.go @@ -5,12 +5,15 @@ package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/cosmos/gogoproto/proto" + + _ "github.com/cosmos/gogoproto/gogoproto" + + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/logic/migrations/v2/types/query.pb.go b/x/logic/migrations/v2/types/query.pb.go index b0a80287..62fb7758 100644 --- a/x/logic/migrations/v2/types/query.pb.go +++ b/x/logic/migrations/v2/types/query.pb.go @@ -6,16 +6,18 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" + io "io" + math "math" + math_bits "math/bits" + grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" + + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/logic/migrations/v2/types/tx.pb.go b/x/logic/migrations/v2/types/tx.pb.go index 9a1c62dc..388e3272 100644 --- a/x/logic/migrations/v2/types/tx.pb.go +++ b/x/logic/migrations/v2/types/tx.pb.go @@ -6,10 +6,11 @@ package types import ( context "context" fmt "fmt" + math "math" + grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/logic/migrations/v2/types/types.pb.go b/x/logic/migrations/v2/types/types.pb.go index 46ebc63f..3b6a2987 100644 --- a/x/logic/migrations/v2/types/types.pb.go +++ b/x/logic/migrations/v2/types/types.pb.go @@ -5,11 +5,13 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/cosmos/gogoproto/proto" + + _ "github.com/cosmos/gogoproto/gogoproto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/logic/predicate/file.go b/x/logic/predicate/file.go index dddece46..7102d43a 100644 --- a/x/logic/predicate/file.go +++ b/x/logic/predicate/file.go @@ -104,7 +104,7 @@ func (m ioMode) Term() engine.Term { // // # Open a stream from a cosmwasm query. // # The Stream should be read as a string with a read_string/3 predicate, and then closed with the close/1 predicate. -// - open('cosmwasm:okp4-objectarium:okp41lppz4x9dtmccek2m6cezjlwwzup6pdqrkvxjpk95806c3dewgrfq602kgx?query=%7B%22object_data%22%3A%7B%22id%22%3A%222625337e6025495a87cb32eb7f5a042f31e4385fd7e34c90d661bfc94dd539e3%22%7D%7D', 'read', Stream) +// - open('cosmwasm:okp4-objectarium:okp412kgx?query=%7B%22object_data%22%3A%7B%...4dd539e3%22%7D%7D', 'read', Stream) func Open(vm *engine.VM, sourceSink, mode, stream, options engine.Term, k engine.Cont, env *engine.Env) *engine.Promise { var name string switch s := env.Resolve(sourceSink).(type) { diff --git a/x/logic/testutil/expected_keepers_mocks.go b/x/logic/testutil/expected_keepers_mocks.go index a8460868..0482de82 100644 --- a/x/logic/testutil/expected_keepers_mocks.go +++ b/x/logic/testutil/expected_keepers_mocks.go @@ -7,10 +7,11 @@ package testutil import ( reflect "reflect" + gomock "github.com/golang/mock/gomock" + types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" types1 "github.com/cosmos/cosmos-sdk/x/bank/types" - gomock "github.com/golang/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. diff --git a/x/mint/testutil/expected_keepers_mocks.go b/x/mint/testutil/expected_keepers_mocks.go index e3075bfb..5355af18 100644 --- a/x/mint/testutil/expected_keepers_mocks.go +++ b/x/mint/testutil/expected_keepers_mocks.go @@ -7,10 +7,12 @@ package testutil import ( reflect "reflect" + gomock "github.com/golang/mock/gomock" + math "cosmossdk.io/math" + types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" - gomock "github.com/golang/mock/gomock" ) // MockStakingKeeper is a mock of StakingKeeper interface. diff --git a/x/vesting/testutil/expected_keepers_mocks.go b/x/vesting/testutil/expected_keepers_mocks.go index 08fca1cc..1d4f84f2 100644 --- a/x/vesting/testutil/expected_keepers_mocks.go +++ b/x/vesting/testutil/expected_keepers_mocks.go @@ -7,8 +7,9 @@ package testutil import ( reflect "reflect" - types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + + types "github.com/cosmos/cosmos-sdk/types" ) // MockBankKeeper is a mock of BankKeeper interface. From cfe804ba5e664052410ab7e6dd9732fc58ccf5b2 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 16:18:12 +0200 Subject: [PATCH 09/12] ci(workflow): check predicates documentation is up to date --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c47a03d..e7ba036c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -208,6 +208,10 @@ jobs: run: | make doc-proto + - name: Generate predicates documentation + run: | + make doc-predicate + - name: Check Git diff in generated files (proto + docs) run: | if [[ $(git status -s | grep --fixed-strings -v "go.mod" | grep --fixed-strings -v "go.sum") != "" ]]; then From ecbe016dc496f7ae1c91020c07e6e32903e26f35 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 17:31:10 +0200 Subject: [PATCH 10/12] ci(workflow): add job to udate predicate docs repository --- .github/workflows/update-draft-docs.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/update-draft-docs.yml b/.github/workflows/update-draft-docs.yml index dffb6637..0c4f8e6c 100644 --- a/.github/workflows/update-draft-docs.yml +++ b/.github/workflows/update-draft-docs.yml @@ -43,3 +43,21 @@ jobs: "draft": "true" } } + + - name: Update predicates docs repository + uses: fjogeleit/http-request-action@v1 + with: + url: 'https://api.github.com/repos/okp4/docs/actions/workflows/39152549/dispatches' + method: 'POST' + customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OKP4_TOKEN }}"}' + data: |- + { + "ref": "main", + "inputs": { + "version": "main", + "repository": "${{github.repository}}", + "section": "predicates", + "docs_directory": "docs/predicate/*", + "draft": "true" + } + } From 4cacc2d9bcf6cf8578295aa51837d78df112058b Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 19:31:11 +0200 Subject: [PATCH 11/12] build(scripts): replace go function name with predicate name --- scripts/generate_predicates_doc.go | 62 +++++++++++++++++++++--------- scripts/templates/func.gotxt | 7 +++- scripts/templates/text.gotxt | 9 +++-- 3 files changed, 54 insertions(+), 24 deletions(-) diff --git a/scripts/generate_predicates_doc.go b/scripts/generate_predicates_doc.go index 8a963413..e0ea555b 100644 --- a/scripts/generate_predicates_doc.go +++ b/scripts/generate_predicates_doc.go @@ -11,7 +11,6 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/princjef/gomarkdoc" - "github.com/princjef/gomarkdoc/format" "github.com/princjef/gomarkdoc/lang" "github.com/princjef/gomarkdoc/logger" ) @@ -19,24 +18,12 @@ import ( //go:embed templates/*.gotxt var f embed.FS +// globalCtx used to keep track of contexts between templates. +// (yes it's a hack). +var globalCtx = make(map[string]interface{}) + func GeneratePredicateDocumentation() error { - out, err := gomarkdoc.NewRenderer( - gomarkdoc.WithTemplateOverride("text", readTemplateMust("text.gotxt")), - gomarkdoc.WithTemplateOverride("doc", readTemplateMust("doc.gotxt")), - gomarkdoc.WithTemplateOverride("list", readTemplateMust("list.gotxt")), - gomarkdoc.WithTemplateOverride("import", ""), - gomarkdoc.WithTemplateOverride("package", readTemplateMust("package.gotxt")), - gomarkdoc.WithTemplateOverride("file", ""), - gomarkdoc.WithTemplateOverride("func", readTemplateMust("func.gotxt")), - gomarkdoc.WithTemplateOverride("index", ""), - gomarkdoc.WithTemplateFunc("snakecase", sprig.TxtFuncMap()["snakecase"]), - gomarkdoc.WithTemplateFunc("hasSuffix", sprig.TxtFuncMap()["hasSuffix"]), - gomarkdoc.WithTemplateFunc("countSubstr", func(substr string, s string) int { - return strings.Count(s, substr) - }), - gomarkdoc.WithTemplateFunc("dict", sprig.TxtFuncMap()["dict"]), - gomarkdoc.WithFormat(&format.GitHubFlavoredMarkdown{}), - ) + out, err := createRenderer() if err != nil { return err } @@ -56,6 +43,7 @@ func GeneratePredicateDocumentation() error { if err != nil { return err } + content, err := out.Package(pkg) if err != nil { return err @@ -64,6 +52,40 @@ func GeneratePredicateDocumentation() error { return writeToFile("docs/predicate/predicates.md", content) } +func createRenderer() (*gomarkdoc.Renderer, error) { + templateFunctionOpts := make([]gomarkdoc.RendererOption, 0) + + templateFunctionOpts = append( + templateFunctionOpts, + gomarkdoc.WithTemplateOverride("text", readTemplateMust("text.gotxt")), + gomarkdoc.WithTemplateOverride("doc", readTemplateMust("doc.gotxt")), + gomarkdoc.WithTemplateOverride("list", readTemplateMust("list.gotxt")), + gomarkdoc.WithTemplateOverride("import", ""), + gomarkdoc.WithTemplateOverride("package", readTemplateMust("package.gotxt")), + gomarkdoc.WithTemplateOverride("file", ""), + gomarkdoc.WithTemplateOverride("func", readTemplateMust("func.gotxt")), + gomarkdoc.WithTemplateOverride("index", ""), + ) + + for k, v := range sprig.GenericFuncMap() { + templateFunctionOpts = append( + templateFunctionOpts, + gomarkdoc.WithTemplateFunc(k, v), + ) + } + + templateFunctionOpts = append( + templateFunctionOpts, + gomarkdoc.WithTemplateFunc("countSubstr", func(substr string, s string) int { + return strings.Count(s, substr) + }), + gomarkdoc.WithTemplateFunc("globalCtx", func() map[string]interface{} { + return globalCtx + }), + ) + return gomarkdoc.NewRenderer(templateFunctionOpts...) +} + func readTemplateMust(templateName string) string { template, err := f.ReadFile("templates/" + templateName) if err != nil { @@ -78,7 +100,9 @@ func writeToFile(filePath string, content string) error { if err != nil { return fmt.Errorf("failed to create file %s: %w", filePath, err) } - defer file.Close() + defer func(file *os.File) { + _ = file.Close() + }(file) w := bufio.NewWriter(file) if _, err = w.WriteString(content); err != nil { diff --git a/scripts/templates/func.gotxt b/scripts/templates/func.gotxt index cbc01aa5..9bd6d7c4 100644 --- a/scripts/templates/func.gotxt +++ b/scripts/templates/func.gotxt @@ -1,7 +1,10 @@ {{- $name := snakecase .Name -}} -{{ $arity := add (countSubstr "," .Signature) -2 }} +{{- $arity := sub (countSubstr "," .Signature) 2 -}} +{{- $predicate := print $name "/" $arity -}} +{{- $_ := set globalCtx "funcName" .Name -}} +{{- $_ := set globalCtx "predicate" $predicate -}} -## {{ $name -}}/{{- $arity -}} +## {{ $predicate -}} {{- spacer -}} {{- template "doc" .Doc -}} diff --git a/scripts/templates/text.gotxt b/scripts/templates/text.gotxt index 1b93a197..8c2c1851 100644 --- a/scripts/templates/text.gotxt +++ b/scripts/templates/text.gotxt @@ -1,10 +1,13 @@ +{{- $funcName := get globalCtx "funcName" -}} +{{- $predicate := get globalCtx "predicate" -}} + {{- range . -}} {{- if eq .Kind "text" -}} - {{- escape .Text -}} + {{- escape .Text | replace $funcName $predicate -}} {{- else if eq .Kind "rawText" -}} - {{- .Text -}} + {{- .Text | replace $funcName $predicate -}} {{- else if eq .Kind "autolink" -}} - {{- .Text -}} + {{- .Text | replace $funcName $predicate -}} {{- else if eq .Kind "link" -}} {{- link (escape .Text) .URL -}} {{- end -}} From b8f2af406a462f997ef049ca25f92b2a851213f7 Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 23 Oct 2023 19:33:04 +0200 Subject: [PATCH 12/12] docs(logic): generate predicate documentation --- docs/predicate/predicates.md | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/predicate/predicates.md b/docs/predicate/predicates.md index 3ea2aae9..d5ec691f 100644 --- a/docs/predicate/predicates.md +++ b/docs/predicate/predicates.md @@ -2,7 +2,7 @@ ## bank_balances/2 -BankBalances is a predicate which unifies the given terms with the list of balances \(coins\) of the given account. +bank_balances/2 is a predicate which unifies the given terms with the list of balances \(coins\) of the given account. The signature is as follows: @@ -30,7 +30,7 @@ Examples: ## bank_locked_balances/2 -BankLockedBalances is a predicate which unifies the given terms with the list of locked coins of the given account. +bank_locked_balances/2 is a predicate which unifies the given terms with the list of locked coins of the given account. The signature is as follows: @@ -58,7 +58,7 @@ Examples: ## bank_spendable_balances/2 -BankSpendableBalances is a predicate which unifies the given terms with the list of spendable coins of the given account. +bank_spendable_balances/2 is a predicate which unifies the given terms with the list of spendable coins of the given account. The signature is as follows: @@ -86,7 +86,7 @@ Examples: ## bech32_address/2 -Bech32Address is a predicate that convert a [bech32]() encoded string into [base64]() bytes and give the address prefix, or convert a prefix \(HRP\) and [base64]() encoded bytes to [bech32]() encoded string. +bech32_address/2 is a predicate that convert a [bech32]() encoded string into [base64]() bytes and give the address prefix, or convert a prefix \(HRP\) and [base64]() encoded bytes to [bech32]() encoded string. The signature is as follows: @@ -114,7 +114,7 @@ base64 encoded value (Address). ## block_height/1 -BlockHeight is a predicate which unifies the given term with the current block height. +block_height/1 is a predicate which unifies the given term with the current block height. The signature is as follows: @@ -135,7 +135,7 @@ Examples: ## block_time/1 -BlockTime is a predicate which unifies the given term with the current block time. +block_time/1 is a predicate which unifies the given term with the current block time. The signature is as follows: @@ -156,28 +156,28 @@ Examples: ## chain_id/1 -ChainID is a predicate which unifies the given term with the current chain ID. The signature is: +chain_id/1 is a predicate which unifies the given term with the current chain ID. The signature is: The signature is as follows: ```text -chain_id(?ChainID) +chain_id(?chain_id/1) ``` where: -- ChainID represents the current chain ID at the time of the query. +- chain_id/1 represents the current chain ID at the time of the query. Examples: ```text # Query the current chain ID. -- chain_id(ChainID). +- chain_id(chain_id/1). ``` ## did_components/2 -DIDComponents is a predicate which breaks down a DID into its components according to the [W3C DID]() specification. +did_components/2 is a predicate which breaks down a DID into its components according to the [W3C DID]() specification. The signature is as follows: @@ -203,7 +203,7 @@ Examples: ## hex_bytes/2 -HexBytes is a predicate that unifies hexadecimal encoded bytes to a list of bytes. +hex_bytes/2 is a predicate that unifies hexadecimal encoded bytes to a list of bytes. The signature is as follows: @@ -225,7 +225,7 @@ Examples: ## json_prolog/2 -JSONProlog is a predicate that will unify a JSON string into prolog terms and vice versa. +json_prolog/2 is a predicate that will unify a JSON string into prolog terms and vice versa. The signature is as follows: @@ -249,7 +249,7 @@ Examples: ## open/4 -Open is a predicate that unify a stream with a source sink on a virtual file system. +open/4 is a predicate that unify a stream with a source sink on a virtual file system. The signature is as follows: @@ -267,14 +267,14 @@ Where: Examples: ```text -# Open a stream from a cosmwasm query. +# open/4 a stream from a cosmwasm query. # The Stream should be read as a string with a read_string/3 predicate, and then closed with the close/1 predicate. - open('cosmwasm:okp4-objectarium:okp412kgx?query=%7B%22object_data%22%3A%7B%...4dd539e3%22%7D%7D', 'read', Stream) ``` ## read_string/3 -ReadString is a predicate that reads characters from the provided Stream and unifies them with String. Users can optionally specify a maximum length for reading; if the stream reaches this length, the reading stops. If Length remains unbound, the entire Stream is read, and upon completion, Length is unified with the count of characters read. +read_string/3 is a predicate that reads characters from the provided Stream and unifies them with String. Users can optionally specify a maximum length for reading; if the stream reaches this length, the reading stops. If Length remains unbound, the entire Stream is read, and upon completion, Length is unified with the count of characters read. The signature is as follows: @@ -308,7 +308,7 @@ Length = 11 ## sha_hash/2 -SHAHash is a predicate that computes the Hash of the given Data. +sha_hash/2 is a predicate that computes the Hash of the given Data. The signature is as follows: @@ -333,7 +333,7 @@ Examples: ## source_file/1 -SourceFile is a predicate that unify the given term with the currently loaded source file. +source_file/1 is a predicate that unify the given term with the currently loaded source file. The signature is as follows: @@ -357,7 +357,7 @@ Examples: ## uri_encoded/3 -URIEncoded is a predicate that unifies the given URI component with the given encoded or decoded string. +uri_encoded/3 is a predicate that unifies the given URI component with the given encoded or decoded string. The signature is as follows: