Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated go version 1.23.3 #1026

Merged
merged 4 commits into from
Nov 21, 2024
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
3 changes: 1 addition & 2 deletions app/amino_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app_test

import (
"fmt"
"reflect"
"testing"
_ "unsafe"
Expand Down Expand Up @@ -129,7 +128,7 @@ func TestLegacyAmino_ExpectedMessages(t *testing.T) {
}

_, expectedNonAmino := expectedNonAminoMsgURLs[messageURL]
require.True(t, expectedNonAmino, fmt.Sprintf("Unexpected non-amino message:%s", messageURL))
require.True(t, expectedNonAmino, "Unexpected non-amino message:%s", messageURL)
delete(expectedNonAminoMsgURLs, messageURL)
}

Expand Down
2 changes: 1 addition & 1 deletion build/coreum/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func buildCoredInDocker(
default:
return errors.Errorf("building is not possible for platform %s", targetPlatform)
}
envs = append(envs, fmt.Sprintf("CC=%s", cc))
envs = append(envs, "CC="+cc)

versionLDFlags, err := coredVersionLDFlags(ctx, buildTags, mod)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion build/coreum/generate-proto-breaking.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func breakingProto(ctx context.Context, deps types.DepsFunc) error {
args := []string{
"--buf-breaking_out=.",
fmt.Sprintf("--buf-breaking_opt=%s", configBuf),
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-buf-breaking", tools.TargetPlatformLocal)),
"--plugin=" + tools.Path("bin/protoc-gen-buf-breaking", tools.TargetPlatformLocal),
}

args = append(args, includeArgs...)
Expand Down
3 changes: 1 addition & 2 deletions build/coreum/generate-proto-docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package coreum

import (
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -51,7 +50,7 @@ func executeProtocCommand(ctx context.Context, deps types.DepsFunc, includeDirs,

args := []string{
"--doc_out=docs",
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-doc", tools.TargetPlatformLocal)),
"--plugin=" + tools.Path("bin/protoc-gen-doc", tools.TargetPlatformLocal),
"--doc_opt=docs/api.tmpl.md,api.md",
}

Expand Down
5 changes: 2 additions & 3 deletions build/coreum/generate-proto-go.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package coreum
import (
"bufio"
"context"
"fmt"
"io"
"io/fs"
"os"
Expand Down Expand Up @@ -61,8 +60,8 @@ func executeGoProtocCommand(ctx context.Context, deps types.DepsFunc, includeDir
args := []string{
"--gocosmos_out=plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:.",
"--grpc-gateway_out=logtostderr=true:.",
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-gocosmos", tools.TargetPlatformLocal)),
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-grpc-gateway", tools.TargetPlatformLocal)),
"--plugin=" + tools.Path("bin/protoc-gen-gocosmos", tools.TargetPlatformLocal),
"--plugin=" + tools.Path("bin/protoc-gen-grpc-gateway", tools.TargetPlatformLocal),
}

for _, path := range includeDirs {
Expand Down
2 changes: 1 addition & 1 deletion build/coreum/generate-proto-lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func executeLintProtocCommand(ctx context.Context, deps types.DepsFunc, includeD
args := []string{
"--buf-lint_out=.",
fmt.Sprintf("--buf-lint_opt=%s", configLint),
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-buf-lint", tools.TargetPlatformLocal)),
"--plugin=" + tools.Path("bin/protoc-gen-buf-lint", tools.TargetPlatformLocal),
}

for _, path := range includeDirs {
Expand Down
2 changes: 1 addition & 1 deletion build/coreum/generate-proto-openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func executeOpenAPIProtocCommand(ctx context.Context, deps types.DepsFunc, inclu

args := []string{
"--openapiv2_out=logtostderr=true,allow_merge=true,json_names_for_fields=false,fqn_for_openapi_name=true,simple_operation_ids=true,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:.", //nolint:lll // breaking down this string will make it more complicated.
fmt.Sprintf("--plugin=%s", tools.Path("bin/protoc-gen-openapiv2", tools.TargetPlatformLocal)),
"--plugin=" + tools.Path("bin/protoc-gen-openapiv2", tools.TargetPlatformLocal),
}

for _, path := range includeDirs {
Expand Down
4 changes: 2 additions & 2 deletions build/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreum/build

go 1.22.4
go 1.23.3

replace github.com/CoreumFoundation/coreum/v5 => ../

Expand Down Expand Up @@ -28,7 +28,7 @@ replace (
require (
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68
github.com/CoreumFoundation/coreum/v5 v5.0.0-20241022051641-b49ec5faa621
github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2
github.com/CoreumFoundation/crust v0.0.0-20241119103533-4a2dd90bbd7c
github.com/iancoleman/strcase v0.3.0
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.39.0
Expand Down
4 changes: 2 additions & 2 deletions build/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68 h1:Tb9avuSQW3smVGrUnDh/Y+ML4eK802UsvJNZHsBgOGg=
github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68/go.mod h1:VD93vCHkxYaT/RhOesXTFgd/GQDW54tr0BqGi5JU1c0=
github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2 h1:YCaird/0FrYgMAajomVBJ/aClatBcorVi1vAmYNjH2w=
github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2/go.mod h1:95ZdELt65yNef7qty4vvRBcBgkgw0L0+td2tNa/JKTM=
github.com/CoreumFoundation/crust v0.0.0-20241119103533-4a2dd90bbd7c h1:WOM8Nu9APDJayYpF7vSO8ZUmossqXo0VQB92q8f7BU4=
github.com/CoreumFoundation/crust v0.0.0-20241119103533-4a2dd90bbd7c/go.mod h1:DC2Jq9oOJgDccdSqwxggqoFJ+EMn1wl8hMXAnnK4DSs=
github.com/CosmWasm/wasmd v0.53.0 h1:kdaoAi20bIb4VCsxw9pRaT2g5PpIp82Wqrr9DRVN9ao=
github.com/CosmWasm/wasmd v0.53.0/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw=
github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20=
Expand Down
9 changes: 4 additions & 5 deletions cmd/cored/cosmoscmd/gas_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,31 @@ func TestAutoGasPrices(t *testing.T) {
},
{
name: "specific gas prices are provided",
flags: []string{fmt.Sprintf("--gas-prices=0.1%s", denom), "--gas=115000"},
flags: []string{"--gas-prices=0.1" + denom, "--gas=115000"},
feeAssertion: func(t *testing.T, fee sdk.Coins) {
assert.True(t, fee.Equal(sdk.NewCoins(sdk.NewCoin(denom, sdkmath.NewInt(11500)))))
},
},
{
name: "specific fees are provided",
flags: []string{fmt.Sprintf("--fees=12345%s", denom)},
flags: []string{"--fees=12345" + denom},
feeAssertion: func(t *testing.T, fee sdk.Coins) {
assert.True(t, fee.Equal(sdk.NewCoins(sdk.NewCoin(denom, sdkmath.NewInt(12345)))))
},
},
{
name: "both gas prices and fees are provided",
flags: []string{fmt.Sprintf("--fees=12345%s", denom), "--gas-prices=auto"},
flags: []string{"--fees=12345" + denom, "--gas-prices=auto"},
expectError: true,
},
}

for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
requireT := require.New(t)
recipient := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address())
args := append([]string{
"send", testNetwork.Validators[0].Address.String(), recipient.String(), fmt.Sprintf("100%s", denom),
"send", testNetwork.Validators[0].Address.String(), recipient.String(), "100" + denom,
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
}, tc.flags...)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cored/cosmoscmd/generate_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

inputContent, err := os.ReadFile(inputPath)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("failed to read file %s", inputPath))
return errors.Wrap(err, "failed to read file "+inputPath)

Check warning on line 46 in cmd/cored/cosmoscmd/generate_network.go

View check run for this annotation

Codecov / codecov/patch

cmd/cored/cosmoscmd/generate_network.go#L46

Added line #L46 was not covered by tests
}

var genCfg config.GenesisInitConfig
Expand Down
3 changes: 1 addition & 2 deletions cmd/cored/cosmoscmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package cosmoscmd

import (
"context"
"fmt"
"io"
"os"
"time"
Expand Down Expand Up @@ -177,7 +176,7 @@ func initAppConfig() (string, interface{}) {
// own app.toml to override, or use this default value.
//
// In app, we set the min gas prices to 0.
srvCfg.MinGasPrices = fmt.Sprintf("0.00000000000000001%s", app.ChosenNetwork.Denom())
srvCfg.MinGasPrices = "0.00000000000000001" + app.ChosenNetwork.Denom()

// WASMConfig defines configuration for the wasm module.
type WASMConfig struct {
Expand Down
1 change: 1 addition & 0 deletions cmd/cored/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
cosmoscmd.OverwriteDefaultChainIDFlags(rootCmd)
rootCmd.PersistentFlags().String(flags.FlagChainID, string(app.DefaultChainID), "The network chain ID")
if err := svrcmd.Execute(rootCmd, coreumEnvPrefix, app.DefaultNodeHome); err != nil {
//nolint:errcheck // we are already exiting the app so we don't check error.

Check warning on line 29 in cmd/cored/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/cored/main.go#L29

Added line #L29 was not covered by tests
fmt.Fprintln(rootCmd.OutOrStderr(), err)
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreum/v5

go 1.22.4
go 1.23.3

replace (
// TODO(https://github.com/cosmos/rosetta/issues/76): Rosetta requires cosmossdk.io/core v0.12.0 erroneously but
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.22.4
go 1.23.3

use .

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreum/v5/integration-tests

go 1.22.4
go 1.23.3

replace (
// cosmos keyring
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/modules/assetft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func TestAssetFTIssue(t *testing.T) {
}

for _, tc := range testCases {
tc := tc
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()
issuer := chain.GenAccount()
Expand Down Expand Up @@ -5178,7 +5177,6 @@ func TestAssetFTFreeze_WithRates(t *testing.T) {
}

for _, tc := range testData {
tc := tc
t.Run(tc.description, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/modules/assetnft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestAssetNFTIssueClass(t *testing.T) {
var data2 assetnfttypes.DataBytes
requireT.NoError(proto.Unmarshal(assetNftClassRes.Class.Data.Value, &data2))

requireT.Equal(jsonData, data2.Data)
requireT.JSONEq(string(jsonData), string(data2.Data))

assetNftClassesRes, err := assetNftClient.Classes(ctx, &assetnfttypes.QueryClassesRequest{
Issuer: issuer.String(),
Expand Down Expand Up @@ -576,7 +576,7 @@ func TestAssetNFTMint(t *testing.T) {
var data2 assetnfttypes.DataBytes
requireT.NoError(proto.Unmarshal(nftRes.Nft.Data.Value, &data2))

requireT.Equal(jsonData, data2.Data)
requireT.JSONEq(string(jsonData), string(data2.Data))

// check the owner
ownerRes, err := nftClient.Owner(ctx, &nft.QueryOwnerRequest{
Expand Down
4 changes: 1 addition & 3 deletions integration-tests/modules/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ func TestGasEstimation(t *testing.T) {
},
}
for _, tt := range testsDeterm {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -401,7 +400,6 @@ func TestGasEstimation(t *testing.T) {
},
}
for _, tt := range testsNonDeterm {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
_, estimatedGas, err := client.CalculateGas(
Expand All @@ -411,7 +409,7 @@ func TestGasEstimation(t *testing.T) {
tt.msgs...,
)
require.NoError(t, err)
require.Greater(t, int(estimatedGas), 0)
require.Positive(t, int(estimatedGas))
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/modules/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestBankSendDeterministicGas(t *testing.T) {

require.Equal(t, "cosmos.bank.v1beta1.MsgSend", gasEvents[0].MsgURL)
require.Equal(t, msgGas, gasEvents[0].DeterministicGas)
require.Greater(t, gasEvents[0].RealGas, uint64(0))
require.Positive(t, gasEvents[0].RealGas)
}

// TestBankSendDeterministicGasTwoBankSends checks that transfer takes the deterministic amount of gas.
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestBankSendDeterministicGasManyCoins(t *testing.T) {
amountToSend := sdkmath.NewInt(1000)

issueMsgs := make([]sdk.Msg, 0, numOfTokens)
for i := 0; i < numOfTokens; i++ {
for i := range numOfTokens {
issueMsgs = append(issueMsgs, &assetfttypes.MsgIssue{
Issuer: sender.String(),
Symbol: fmt.Sprintf("TOK%d", i),
Expand Down Expand Up @@ -256,7 +256,7 @@ func TestBankMultiSendDeterministicGasManyCoins(t *testing.T) {
amountToSend := sdkmath.NewInt(1000)

issueMsgs := make([]sdk.Msg, 0, numOfTokens)
for i := 0; i < numOfTokens; i++ {
for i := range numOfTokens {
issueMsgs = append(issueMsgs, &assetfttypes.MsgIssue{
Issuer: sender.String(),
Symbol: fmt.Sprintf("TOK%d", i),
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/modules/feemodel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestFeeModelProposalParamChange(t *testing.T) {
feeModelParamsRes, err = feeModelClient.Params(ctx, &feemodeltypes.QueryParamsRequest{})
requireT.NoError(err)
assertT.Equal(feeModelParamsRes.Params.Model.MaxDiscount.String(), targetMaxDiscount.String())
assertT.Equal(feeModelParamsRes.Params.Model.String(), feeModelParamsRes.Params.Model.String())
assertT.Equal(newParams.Model.String(), feeModelParamsRes.Params.Model.String())
}

func getFeemodelParams(ctx context.Context, t *testing.T, clientCtx client.Context) feemodeltypes.ModelParams {
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/modules/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package modules

import (
"context"
"fmt"
"testing"
"time"

Expand Down Expand Up @@ -501,7 +500,7 @@ func setUnbondingTimeViaGovernance(
ctx,
proposer,
[]sdk.Msg{msgUpdateParam},
fmt.Sprintf("Change the unbnunbondingdig time to %s", unbondingTime.String()),
"Change the unbnunbondingdig time to "+unbondingTime.String(),
"Changing unbonding time for the integration test",
"Changing unbonding time for the integration test",
false,
Expand Down
7 changes: 3 additions & 4 deletions integration-tests/modules/wasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func TestWASMBankSendContract(t *testing.T) {

require.Equal(t, "cosmos.bank.v1beta1.MsgSend", gasEvents[0].MsgURL)
require.Equal(t, msgGas, gasEvents[0].DeterministicGas)
require.Greater(t, gasEvents[0].RealGas, uint64(0))
require.Positive(t, gasEvents[0].RealGas)
}

// TestWASMGasBankSendAndBankSend checks that a message containing a deterministic and a
Expand Down Expand Up @@ -1949,7 +1949,7 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {

royaltyRate := "100000000000000000" // 1e18 = 10%
data := make([]byte, 256)
for i := 0; i < 256; i++ {
for i := range 256 {
data[i] = uint8(i)
}
encodedData := base64.StdEncoding.EncodeToString(data)
Expand Down Expand Up @@ -2537,7 +2537,7 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) {

royaltyRate := sdkmath.LegacyMustNewDecFromStr("0.1")
data := make([]byte, 256)
for i := 0; i < 256; i++ {
for i := range 256 {
data[i] = uint8(i)
}
encodedData := base64.StdEncoding.EncodeToString(data)
Expand Down Expand Up @@ -3441,7 +3441,6 @@ func TestWASMContractInstantiationIsNotRejectedIfAccountExists(t *testing.T) {
}

for _, tc := range testCases {
tc := tc
t.Run(tc.Name, func(t *testing.T) {
t.Parallel()

Expand Down
Loading