Skip to content

Commit

Permalink
fix(wallet/backend.go): Return just one error instead of concatenatio…
Browse files Browse the repository at this point in the history
…n of errors

chore(All): Run gofmt and sort imports

Signed-off-by: Sophia Koehler <sophia@perun.network>
  • Loading branch information
sophia1ch committed Dec 19, 2024
1 parent dac83b9 commit 5e5bfb3
Show file tree
Hide file tree
Showing 88 changed files with 157 additions and 79 deletions.
1 change: 1 addition & 0 deletions apps/payment/randomizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package payment

import (
"math/rand"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
Expand Down
1 change: 1 addition & 0 deletions backend/sim/channel/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package channel

import (
"math/rand"

"perun.network/go-perun/channel"
"perun.network/go-perun/channel/test"
)
Expand Down
1 change: 1 addition & 0 deletions channel/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"io"
"log"
"math/big"

"perun.network/go-perun/wallet"

"perun.network/go-perun/wire/perunio"
Expand Down
3 changes: 2 additions & 1 deletion channel/allocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package channel_test
import (
"math/big"
"math/rand"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
3 changes: 2 additions & 1 deletion channel/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ package channel

import (
"encoding"
"github.com/pkg/errors"
"io"

"github.com/pkg/errors"

"perun.network/go-perun/wire/perunio"
)

Expand Down
1 change: 1 addition & 0 deletions channel/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package channel

import (
"errors"

"perun.network/go-perun/wallet"
)

Expand Down
1 change: 1 addition & 0 deletions channel/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package channel

import (
"fmt"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
3 changes: 2 additions & 1 deletion channel/errors_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ package channel

import (
"errors"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion channel/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ package channel

import (
"fmt"
"github.com/pkg/errors"
stdio "io"

"github.com/pkg/errors"

"perun.network/go-perun/log"
"perun.network/go-perun/wallet"
"perun.network/go-perun/wire/perunio"
Expand Down
3 changes: 2 additions & 1 deletion channel/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package channel_test

import (
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/require"
"perun.network/go-perun/channel"
"perun.network/go-perun/channel/test"
Expand Down
1 change: 1 addition & 0 deletions channel/mock_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package channel
import (
"encoding/binary"
"fmt"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
3 changes: 2 additions & 1 deletion channel/mock_app_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package channel

import (
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/assert"

wiretest "perun.network/go-perun/wire/test"
Expand Down
1 change: 1 addition & 0 deletions channel/multi/adjudicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package multi
import (
"context"
"fmt"

"perun.network/go-perun/channel"
)

Expand Down
1 change: 1 addition & 0 deletions channel/multi/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package multi

import (
"context"

"perun.network/go-perun/channel"
"perun.network/go-perun/wallet"
)
Expand Down
3 changes: 2 additions & 1 deletion channel/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package channel_test

import (
"github.com/stretchr/testify/require"
"testing"

"github.com/stretchr/testify/require"

"perun.network/go-perun/channel"
"perun.network/go-perun/channel/test"
"perun.network/go-perun/wire/perunio"
Expand Down
1 change: 1 addition & 0 deletions channel/persistence/keyvalue/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func newChannelCache() *channelCache {
}

// channelCache contains all channels.
//
//nolint:unused
type channelCache struct {
mutex stdsync.RWMutex
Expand Down
1 change: 1 addition & 0 deletions channel/persistence/keyvalue/persistedstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package keyvalue

import (
"io"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
Expand Down
3 changes: 2 additions & 1 deletion channel/persistence/keyvalue/persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import (
"context"
"fmt"
"math"
"perun.network/go-perun/wallet"
"regexp"
"strconv"
"strings"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"

"perun.network/go-perun/channel"
Expand Down
1 change: 1 addition & 0 deletions channel/persistence/nonpersister.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package persistence

import (
"context"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
1 change: 1 addition & 0 deletions channel/persistence/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package persistence
import (
"context"
"io"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
Expand Down
3 changes: 2 additions & 1 deletion channel/persistence/statemachine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ package persistence_test

import (
"context"
"perun.network/go-perun/wallet"
"testing"
"time"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/require"

"perun.network/go-perun/channel"
Expand Down
1 change: 1 addition & 0 deletions channel/persistence/test/peerchans.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package test
import (
"bytes"
"fmt"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
Expand Down
3 changes: 2 additions & 1 deletion channel/persistence/test/peerchans_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package test

import (
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/assert"

"perun.network/go-perun/channel"
Expand Down
3 changes: 2 additions & 1 deletion channel/persistence/test/persistrestorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package test // import "perun.network/go-perun/channel/persistence/test"
import (
"bytes"
"context"
"perun.network/go-perun/wallet"
"sync"
"testing"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

Expand Down
3 changes: 2 additions & 1 deletion channel/persistence/test/persistrestorertest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package test
import (
"context"
"math/rand"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
1 change: 1 addition & 0 deletions channel/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package channel
import (
"encoding"
"io"

"perun.network/go-perun/wallet"
"perun.network/go-perun/wire"

Expand Down
1 change: 1 addition & 0 deletions channel/test/app_randomizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package test

import (
"math/rand"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
Expand Down
1 change: 1 addition & 0 deletions channel/test/mock_app_randomizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package test

import (
"math/rand"

"perun.network/go-perun/wallet"

"github.com/google/uuid"
Expand Down
3 changes: 2 additions & 1 deletion channel/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package channel_test

import (
"github.com/stretchr/testify/require"
"testing"

"github.com/stretchr/testify/require"

"perun.network/go-perun/channel"
"perun.network/go-perun/channel/test"
peruniotest "perun.network/go-perun/wire/perunio/test"
Expand Down
1 change: 1 addition & 0 deletions client/adjudicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package client

import (
"context"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
3 changes: 2 additions & 1 deletion client/appchannel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package client_test
import (
"context"
"math/big"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
chtest "perun.network/go-perun/channel/test"
"perun.network/go-perun/client"
Expand Down
1 change: 1 addition & 0 deletions client/channelconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package client

import (
"context"

"github.com/pkg/errors"
"golang.org/x/sync/errgroup"
"perun.network/go-perun/wallet"
Expand Down
3 changes: 2 additions & 1 deletion client/chanregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
package client

import (
"perun.network/go-perun/wallet"
"sync"

"perun.network/go-perun/wallet"

"perun.network/go-perun/channel"
psync "polycry.pt/poly-go/sync"
)
Expand Down
3 changes: 2 additions & 1 deletion client/client_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (
"context"
"math/big"
"math/rand"
"perun.network/go-perun/wallet"
"testing"
"time"

"perun.network/go-perun/wallet"

"perun.network/go-perun/apps/payment"
chtest "perun.network/go-perun/channel/test"
"perun.network/go-perun/client"
Expand Down
3 changes: 2 additions & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ package client_test

import (
"context"
"perun.network/go-perun/wallet"
"testing"
"time"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
1 change: 1 addition & 0 deletions client/clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package client

import (
"context"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
3 changes: 2 additions & 1 deletion client/payment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (
"context"
"math/big"
"math/rand"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

chtest "perun.network/go-perun/channel/test"
"perun.network/go-perun/client"
ctest "perun.network/go-perun/client/test"
Expand Down
3 changes: 2 additions & 1 deletion client/proposal_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ package client

import (
"math/rand"
"perun.network/go-perun/wallet"
"testing"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
1 change: 1 addition & 0 deletions client/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package client

import (
"context"

"perun.network/go-perun/wallet"

"github.com/pkg/errors"
Expand Down
Loading

0 comments on commit 5e5bfb3

Please sign in to comment.