Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
go-version: "1.24.x"
cache: false
- name: Install gitlint
run: |
Expand All @@ -61,9 +61,9 @@ jobs:
# NOTE: Using the official golangci-lint GitHub Action should give
# better performance than manually installing golangci-lint and running
# 'make lint-go'.
uses: golangci/golangci-lint-action@v6.1.0
uses: golangci/golangci-lint-action@v6.5.0
with:
version: v1.61
version: v1.64
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Ensure a clean code checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
go-version: "1.24.x"
- name: Cache Go dependencies
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
go-version: "1.24.x"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
7 changes: 3 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ linters:
- dupl
- errcheck
- exhaustive
- exportloopref
- goconst
- gocritic
- gocyclo
Expand Down Expand Up @@ -56,6 +55,9 @@ linters-settings:
- $all
allow:
- $gostd
- golang.org/x/sys/unix
- golang.org/x/crypto/sha3
- golang.org/x/crypto/argon2
- github.com/oasisprotocol
- github.com/btcsuite/btcd
- github.com/adrg/xdg
Expand All @@ -82,6 +84,3 @@ linters-settings:
# Switch statements are to be considered exhaustive if a 'default' case is
# present, even if all enum members aren't listed in the switch.
default-signifies-exhaustive: true
govet:
# Enabled checking for shadowed variables.
check-shadowing: true
2 changes: 1 addition & 1 deletion build/rofl/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var LatestContainerArtifacts = ArtifactsConfig{
Kernel: "https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage1.bin#06e12cba9b2423b4dd5916f4d84bf9c043f30041ab03aa74006f46ef9c129d22",
Stage2: "https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage2-podman.tar.bz2#6f2487aa064460384309a58c858ffea9316e739331b5c36789bb2f61117869d6",
Container: ContainerArtifactsConfig{
Runtime: "https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.4.2/rofl-containers#0cbaa4c0c1b35c5ed41156868bee9f3726f52eeedc01b3060d3b2eb67d76f546",
Runtime: "https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.5.0/rofl-containers#800be74e543f1d10d12ef6fadce89dd0a0ce7bc798dbab4f8d7aa012d82fbff1",
Compose: "compose.yaml",
},
}
8 changes: 4 additions & 4 deletions cmd/account/show/delegations.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const amountFieldName = "Amount:"

// lenLongestString returns the length of the longest string passed to it.
func lenLongestString(strs ...string) int {
max := 0
maxLen := 0
for _, s := range strs {
if len(s) > max {
max = len(s)
if len(s) > maxLen {
maxLen = len(s)
}
}
return max
return maxLen
}

// delegationDescription is a description of a (debonding) delegation.
Expand Down
22 changes: 11 additions & 11 deletions config/addressbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ func (ab *AddressBook) Remove(name string) error {
}

// Rename renames an existing address book entry.
func (ab *AddressBook) Rename(old, new string) error {
cfg, exists := ab.All[old]
func (ab *AddressBook) Rename(oldName, newName string) error {
cfg, exists := ab.All[oldName]
if !exists {
return fmt.Errorf("address named '%s' does not exist in the address book", old)
return fmt.Errorf("address named '%s' does not exist in the address book", oldName)
}

if _, exists = ab.All[new]; exists {
return fmt.Errorf("address named '%s' already exists in the address book", new)
if _, exists = ab.All[newName]; exists {
return fmt.Errorf("address named '%s' already exists in the address book", newName)
}

if err := config.ValidateIdentifier(old); err != nil {
return fmt.Errorf("malformed old address name '%s': %w", old, err)
if err := config.ValidateIdentifier(oldName); err != nil {
return fmt.Errorf("malformed old address name '%s': %w", oldName, err)
}
if err := config.ValidateIdentifier(new); err != nil {
return fmt.Errorf("malformed new address name '%s': %w", new, err)
if err := config.ValidateIdentifier(newName); err != nil {
return fmt.Errorf("malformed new address name '%s': %w", newName, err)
}

ab.All[new] = cfg
delete(ab.All, old)
ab.All[newName] = cfg
delete(ab.All, oldName)

return nil
}
Expand Down
28 changes: 14 additions & 14 deletions config/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,38 +156,38 @@ func (w *Wallet) Remove(name string) error {
}

// Rename renames an existing account.
func (w *Wallet) Rename(old, new string) error {
cfg, exists := w.All[old]
func (w *Wallet) Rename(oldName, newName string) error {
cfg, exists := w.All[oldName]
if !exists {
return fmt.Errorf("account '%s' does not exist in the wallet", old)
return fmt.Errorf("account '%s' does not exist in the wallet", oldName)
}

if _, exists = w.All[new]; exists {
return fmt.Errorf("account '%s' already exists in the wallet", new)
if _, exists = w.All[newName]; exists {
return fmt.Errorf("account '%s' already exists in the wallet", newName)
}

if err := config.ValidateIdentifier(old); err != nil {
return fmt.Errorf("malformed old account name '%s': %w", old, err)
if err := config.ValidateIdentifier(oldName); err != nil {
return fmt.Errorf("malformed old account name '%s': %w", oldName, err)
}
if err := config.ValidateIdentifier(new); err != nil {
return fmt.Errorf("malformed new account name '%s': %w", new, err)
if err := config.ValidateIdentifier(newName); err != nil {
return fmt.Errorf("malformed new account name '%s': %w", newName, err)
}

af, err := wallet.Load(cfg.Kind)
if err != nil {
return err
}

if err := af.Rename(old, new, cfg.Config); err != nil {
if err := af.Rename(oldName, newName, cfg.Config); err != nil {
return err
}

w.All[new] = cfg
delete(w.All, old)
w.All[newName] = cfg
delete(w.All, oldName)

// Update default if set to this wallet.
if w.Default == old {
w.Default = new
if w.Default == oldName {
w.Default = newName
}

return nil
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/oasisprotocol/cli

go 1.23.2
go 1.24.0

toolchain go1.23.5
toolchain go1.24.2

// v1.5.0 has broken uint parsing, use a commit with the fix until the
// the maintainers merge the PR: https://github.com/spf13/cast/pull/144
Expand All @@ -23,8 +23,8 @@ require (
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7
github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920
github.com/oasisprotocol/oasis-core/go v0.2500.0
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2
github.com/oasisprotocol/oasis-core/go v0.2502.0
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0
github.com/olekukonko/tablewriter v0.0.5
github.com/opencontainers/image-spec v1.1.0
github.com/spf13/cobra v1.9.1
Expand Down Expand Up @@ -159,7 +159,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/term v0.30.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs=
github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920 h1:rugJRYKamNl6WGBaU+b0wLQFkYcsnBr0ycX5QmB+AYU=
github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920/go.mod h1:MKr/giwakLyCCjSWh0W9Pbaf7rDD1K96Wr57OhNoUK0=
github.com/oasisprotocol/oasis-core/go v0.2500.0 h1:VK3bWrw+Z3Ptv1YcTHOqWCS8Io888imnYgd9aohFg4g=
github.com/oasisprotocol/oasis-core/go v0.2500.0/go.mod h1:VGnmXqzTnSjM5Ik+nMyposdUQip9UsT0ebzMA3JfcjE=
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2 h1:ZjLU1nKU3R1Hl231DIWwwbK4Zs8vLixsDUqcdjKxA2A=
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2/go.mod h1:cSeE0PjcOJiXFQKxUAvO/9B0PmraZQAlX6WPZN/UVoI=
github.com/oasisprotocol/oasis-core/go v0.2502.0 h1:B/qr+3HjCF8gN0MmY9Cw9hJ8Em/Lo5Ah8bIi9pgqgDY=
github.com/oasisprotocol/oasis-core/go v0.2502.0/go.mod h1:0wO1wYzDCNToNemyt/wF+1BjcrSBRyw6MJrWr7LvrJs=
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0 h1:QFH193NC5AVgg024xwmOp9UXAygkL4I/HW5lyx2vlhs=
github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0/go.mod h1:ANKdBwpRAMKDePYb6fg6Sk+qhKpTQmrnl8PsEKrHt9M=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
Expand Down Expand Up @@ -729,8 +729,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.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.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
4 changes: 2 additions & 2 deletions wallet/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ func (af *fileAccountFactory) Remove(name string, _ map[string]interface{}) erro
return os.Remove(getAccountFilename(name))
}

func (af *fileAccountFactory) Rename(old, new string, _ map[string]interface{}) error {
return os.Rename(getAccountFilename(old), getAccountFilename(new))
func (af *fileAccountFactory) Rename(oldName, newName string, _ map[string]interface{}) error {
return os.Rename(getAccountFilename(oldName), getAccountFilename(newName))
}

func (af *fileAccountFactory) Import(name string, passphrase string, rawCfg map[string]interface{}, src *wallet.ImportSource) (wallet.Account, error) {
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type Factory interface {
Remove(name string, cfg map[string]interface{}) error

// Rename renames an existing account.
Rename(old, new string, cfg map[string]interface{}) error
Rename(oldName, newName string, cfg map[string]interface{}) error

// Import creates a new account from imported key material.
Import(name string, passphrase string, cfg map[string]interface{}, src *ImportSource) (Account, error)
Expand Down
Loading