From 939c796e4f388834edad86ea991b80c1d842d6a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:07:05 +0000 Subject: [PATCH 1/3] Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 591589dfd..2acebd3d8 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 golang.org/x/text v0.19.0 google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 diff --git a/go.sum b/go.sum index 2a4666b09..54dee4ce4 100644 --- a/go.sum +++ b/go.sum @@ -986,8 +986,9 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= From 7b9b77e6819e4cccf957fe34bb87fea9b9e42d01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Nov 2024 08:07:29 +0000 Subject: [PATCH 2/3] Updated Changelog --- .../dependencies/2226-github-com-stretchr-testify-1-10-0.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/unreleased/dependencies/2226-github-com-stretchr-testify-1-10-0.md diff --git a/.changelog/unreleased/dependencies/2226-github-com-stretchr-testify-1-10-0.md b/.changelog/unreleased/dependencies/2226-github-com-stretchr-testify-1-10-0.md new file mode 100644 index 000000000..3988fd766 --- /dev/null +++ b/.changelog/unreleased/dependencies/2226-github-com-stretchr-testify-1-10-0.md @@ -0,0 +1 @@ +* `github.com/stretchr/testify` bumped to v1.10.0 (from v1.9.0) [PR 2226](https://github.com/provenance-io/provenance/pull/2226). From 9e4635aa480018648d9849c38b780db7a4123ed1 Mon Sep 17 00:00:00 2001 From: Daniel Wedul Date: Tue, 26 Nov 2024 12:05:01 -0700 Subject: [PATCH 3/3] Fix uses of NotSame which now fails if either isn't a pointer. --- x/marker/keeper/keeper_test.go | 4 ++-- x/marker/types/immutable_addresses_test.go | 12 ++++++------ x/metadata/types/signer_utils_test.go | 18 +++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x/marker/keeper/keeper_test.go b/x/marker/keeper/keeper_test.go index d4e35d73a..df118adfb 100644 --- a/x/marker/keeper/keeper_test.go +++ b/x/marker/keeper/keeper_test.go @@ -2947,9 +2947,9 @@ func TestReqAttrBypassAddrs(t *testing.T) { expected := app.MarkerKeeper.GetReqAttrBypassAddrs() actual := app.MarkerKeeper.GetReqAttrBypassAddrs() if assert.Equal(t, expected, actual, "GetReqAttrBypassAddrs()") { - if assert.NotSame(t, expected, actual, "GetReqAttrBypassAddrs()") { + if assert.NotSame(t, &expected, &actual, "GetReqAttrBypassAddrs()") { for i := range expected { - assert.NotSame(t, expected[i], actual[i], "GetReqAttrBypassAddrs()[%d]", i) + assert.NotSame(t, &expected[i], &actual[i], "GetReqAttrBypassAddrs()[%d]", i) } } } diff --git a/x/marker/types/immutable_addresses_test.go b/x/marker/types/immutable_addresses_test.go index ab6602740..f76a9c600 100644 --- a/x/marker/types/immutable_addresses_test.go +++ b/x/marker/types/immutable_addresses_test.go @@ -49,18 +49,18 @@ func TestImmutableAccAddresses(t *testing.T) { // address was copied to a new slice too. addrs := iAddrs.GetSlice() require.Equal(t, tc.addrs, addrs, "GetSlice() compared to expected") - require.NotSame(t, tc.addrs, addrs, "GetSlice() compared to expected") + require.NotSame(t, &tc.addrs, &addrs, "GetSlice() compared to expected") for i := range tc.addrs { - require.NotSame(t, tc.addrs[i], addrs[i], "GetSlice()[%d] compared to expected", i) + require.NotSame(t, &tc.addrs[i], &addrs[i], "GetSlice()[%d] compared to expected", i) } // Get the slice five more times and make sure each one is a fresh copy. for x := 1; x <= 5; x++ { addrs2 := iAddrs.GetSlice() require.Equal(t, addrs, addrs2, "[%d]: GetSlice() compared to previous result", x) - require.NotSame(t, addrs, addrs2, "[%d]: GetSlice() compared to previous result", x) + require.NotSame(t, &addrs, &addrs2, "[%d]: GetSlice() compared to previous result", x) for i := range tc.addrs { - require.NotSame(t, addrs[i], addrs2[i], "[%d]: GetSlice()[%d] compared to previous result", x, i) + require.NotSame(t, &addrs[i], &addrs2[i], "[%d]: GetSlice()[%d] compared to previous result", x, i) } addrs = addrs2 } @@ -168,9 +168,9 @@ func TestDeepCopyAccAddresses(t *testing.T) { // Make sure the result is equal to what was provided, but in a different slice. // Also make sure each entry slice was also copied. if assert.Equal(t, tc.orig, actual, "deepCopyAccAddresses result") { - if assert.NotSame(t, tc.orig, actual, "deepCopyAccAddresses result") { + if assert.NotSame(t, &tc.orig, &actual, "deepCopyAccAddresses result") { for i := range tc.orig { - assert.NotSame(t, tc.orig[i], actual[i], "deepCopyAccAddresses result[%d]", i) + assert.NotSame(t, &tc.orig[i], &actual[i], "deepCopyAccAddresses result[%d]", i) } } } diff --git a/x/metadata/types/signer_utils_test.go b/x/metadata/types/signer_utils_test.go index aebd5e5a3..b50fee288 100644 --- a/x/metadata/types/signer_utils_test.go +++ b/x/metadata/types/signer_utils_test.go @@ -475,8 +475,8 @@ func TestPartyDetails_Copy(t *testing.T) { require.NotPanics(t, testFunc, "Copy()") require.Equal(t, tc.pd, actual, "result of Copy()") if tc.pd != nil && actual != nil { - assert.NotSame(t, tc.pd, actual, "result of Copy()") - assert.NotSame(t, tc.pd.acc, actual.acc, "acc field") + assert.NotSame(t, &tc.pd, &actual, "result of Copy()") + assert.NotSame(t, &tc.pd.acc, &actual.acc, "acc field") if len(actual.acc) > 0 { // Change the first byte in the copy to make sure it doesn't also change in the original. actual.acc[0] = actual.acc[0] + 1 @@ -484,7 +484,7 @@ func TestPartyDetails_Copy(t *testing.T) { // And put it back so we don't mess up anything else. actual.acc[0] = actual.acc[0] - 1 } - assert.NotSame(t, tc.pd.signerAcc, actual.signerAcc, "signerAcc field") + assert.NotSame(t, &tc.pd.signerAcc, &actual.signerAcc, "signerAcc field") if len(actual.signerAcc) > 0 { // Change the first byte in the copy to make sure it doesn't also change in the original. actual.signerAcc[0] = actual.signerAcc[0] + 1 @@ -1825,10 +1825,10 @@ func TestNewTestablePartyDetails(t *testing.T) { } require.NotPanics(t, testFunc, "NewTestablePartyDetails") assert.Equal(t, expected, actual, "result of NewTestablePartyDetails") - assert.NotSame(t, pd.acc, actual.Acc, "the acc field") + assert.NotSame(t, &pd.acc, &actual.Acc, "the acc field") actual.Acc[0] = actual.Acc[0] + 1 assert.NotEqual(t, pd.acc, actual.Acc, "the acc field after a change to it in the result") - assert.NotSame(t, pd.signerAcc, actual.SignerAcc, "the signerAcc field") + assert.NotSame(t, &pd.signerAcc, &actual.SignerAcc, "the signerAcc field") actual.SignerAcc[0] = actual.SignerAcc[0] + 1 assert.NotEqual(t, pd.signerAcc, actual.SignerAcc, "the signerAcc field after a change to it in the result") }) @@ -2067,8 +2067,8 @@ func TestNewAuthzCache(t *testing.T) { assert.Empty(t, c1.isWasm, "isWasm map") assert.NotSame(t, c1, c2, "NewAuthzCache twice") - assert.NotSame(t, c1.acceptable, c2.acceptable, "acceptable maps of two NewAuthzCache") - assert.NotSame(t, c1.isWasm, c2.isWasm, "isWasm maps of two NewAuthzCache") + assert.NotSame(t, &c1.acceptable, &c2.acceptable, "acceptable maps of two NewAuthzCache") + assert.NotSame(t, &c1.isWasm, &c2.isWasm, "isWasm maps of two NewAuthzCache") } func TestAuthzCache_Clear(t *testing.T) { @@ -2274,7 +2274,7 @@ func TestAuthzCache_GetAcceptableMap(t *testing.T) { } require.NotPanics(t, testFunc, "GetAcceptableMap") if expected != nil && actual != nil { - require.NotSame(t, tc.cache.acceptable, actual, "result from GetAcceptableMap") + require.NotSame(t, &tc.cache.acceptable, &actual, "result from GetAcceptableMap") } require.Equal(t, expected, actual, "result from GetAcceptableMap") if len(actual) > 0 { @@ -2370,7 +2370,7 @@ func TestAuthzCache_GetIsWasmMap(t *testing.T) { } require.NotPanics(t, testFunc, "GetIsWasmMap") if expected != nil && actual != nil { - require.NotSame(t, tc.cache.isWasm, actual, "result from GetIsWasmMap") + require.NotSame(t, &tc.cache.isWasm, &actual, "result from GetIsWasmMap") } require.Equal(t, expected, actual, "result from GetIsWasmMap") if len(actual) > 0 {