Skip to content

Commit

Permalink
chore: fix linter import
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Jul 29, 2024
1 parent 1802e83 commit 6b474cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions x/logic/keeper/grpc_query_ask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"

"github.com/golang/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

sdkmath "cosmossdk.io/math"
Expand Down
3 changes: 2 additions & 1 deletion x/logic/util/pointer.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package util

import (
sdkmath "cosmossdk.io/math"
"reflect"

sdkmath "cosmossdk.io/math"
)

// DerefOrDefault returns the value of the pointer if it is not nil, otherwise returns the default value.
Expand Down
15 changes: 12 additions & 3 deletions x/logic/util/pointer_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package util

import (
sdkmath "cosmossdk.io/math"
"fmt"
"testing"

. "github.com/smartystreets/goconvey/convey"

sdkmath "cosmossdk.io/math"
)

func TestDerefOrDefault(t *testing.T) {
Expand Down Expand Up @@ -63,8 +64,16 @@ func TestNonZeroOrDefaultUInt(t *testing.T) {
expected sdkmath.Uint
}{
{nil, sdkmath.ZeroUint(), sdkmath.ZeroUint()},
{v: func() *sdkmath.Uint { u := sdkmath.ZeroUint(); return &u }(), defaultValue: sdkmath.NewUint(10), expected: sdkmath.NewUint(10)},
{v: func() *sdkmath.Uint { u := sdkmath.NewUint(1); return &u }(), defaultValue: sdkmath.ZeroUint(), expected: sdkmath.NewUint(1)},
{
func() *sdkmath.Uint { u := sdkmath.ZeroUint(); return &u }(),
sdkmath.NewUint(10),
sdkmath.NewUint(10),
},
{
func() *sdkmath.Uint { u := sdkmath.NewUint(1); return &u }(),
sdkmath.ZeroUint(),
sdkmath.NewUint(1),
},
}
for _, tc := range cases {
Convey(fmt.Sprintf("When the value is %v", tc.v), func() {
Expand Down

0 comments on commit 6b474cb

Please sign in to comment.