Skip to content

Commit

Permalink
Merge branch 'main' into son/remove_testutil_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 authored Dec 30, 2024
2 parents 4cb52b3 + 4f3f401 commit da593aa
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 86 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/pr-reminder.yml

This file was deleted.

4 changes: 2 additions & 2 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ func TestABCI_Query_SimulateNestedMessagesTx(t *testing.T) {
})
require.NoError(t, err)

baseapptestutil.RegisterNestedMessagesServer(suite.baseApp.MsgServiceRouter(), NestedMessgesServerImpl{})
baseapptestutil.RegisterNestedMessagesServer(suite.baseApp.MsgServiceRouter(), NestedMessagesServerImpl{})
baseapptestutil.RegisterSendServer(suite.baseApp.MsgServiceRouter(), SendServerImpl{})

ac := codectestutil.CodecOptions{}.GetAddressCodec()
Expand Down Expand Up @@ -975,7 +975,7 @@ func TestABCI_Query_SimulateNestedMessagesGas(t *testing.T) {
})
require.NoError(t, err)

baseapptestutil.RegisterNestedMessagesServer(tt.suite.baseApp.MsgServiceRouter(), NestedMessgesServerImpl{})
baseapptestutil.RegisterNestedMessagesServer(tt.suite.baseApp.MsgServiceRouter(), NestedMessagesServerImpl{})
baseapptestutil.RegisterSendServer(tt.suite.baseApp.MsgServiceRouter(), SendServerImpl{})

nestedMessages := make([]*any.Any, 1)
Expand Down
4 changes: 2 additions & 2 deletions baseapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,11 @@ func (s SendServerImpl) Send(ctx context.Context, send *baseapptestutil.MsgSend)
return &baseapptestutil.MsgSendResponse{}, nil
}

type NestedMessgesServerImpl struct {
type NestedMessagesServerImpl struct {
gas uint64
}

func (n NestedMessgesServerImpl) Check(ctx context.Context, message *baseapptestutil.MsgNestedMessages) (*baseapptestutil.MsgCreateNestedMessagesResponse, error) {
func (n NestedMessagesServerImpl) Check(ctx context.Context, message *baseapptestutil.MsgNestedMessages) (*baseapptestutil.MsgCreateNestedMessagesResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
cdc := codectestutil.CodecOptions{}.NewCodec()
baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry())
Expand Down
6 changes: 3 additions & 3 deletions client/grpc/reflection/reflection.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/v2/internal/testpb/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ service Msg {
}

message MsgRequest {
// u32 is an uint32
// u32 is a uint32
uint32 u32 = 1;
uint64 u64 = 2;
string str = 3;
Expand Down
4 changes: 2 additions & 2 deletions client/v2/tx/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ func txParamsFromFlagSet(flags *pflag.FlagSet, keybase keyring2.Keyring, ac addr

fees, _ := flags.GetString(FlagFees)
feePayer, _ := flags.GetString(FlagFeePayer)
feeGrater, _ := flags.GetString(FlagFeeGranter)
feeGranter, _ := flags.GetString(FlagFeeGranter)

unordered, _ := flags.GetBool(FlagUnordered)

gasConfig, err := NewGasConfig(gasValue, gasAdjustment, gasPrices)
if err != nil {
return params, err
}
feeConfig, err := NewFeeConfig(fees, feePayer, feeGrater)
feeConfig, err := NewFeeConfig(fees, feePayer, feeGranter)
if err != nil {
return params, err
}
Expand Down
2 changes: 1 addition & 1 deletion collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ type BaseAccount struct {
```

First of all, when we save our accounts in state we map them using a primary key `sdk.AccAddress`.
If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddres, authtypes.BaseAccount]`.
If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddress, authtypes.BaseAccount]`.

Then we also want to be able to get an account not only by its `sdk.AccAddress`, but also by its `AccountNumber`.

Expand Down
2 changes: 1 addition & 1 deletion core/server/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Server Defines types and interfaces which are shared between Consensus, Appmanager and Stf
// Server Defines types and interfaces which are shared between Consensus, App Manager and Stf
// This package is not meant to be used directly by modules instead if an advanced user would like
// to create a custom server or replace a component in the server they will need to use the app package.
package server
2 changes: 1 addition & 1 deletion crypto/keyring/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Language is a language to create the BIP 39 mnemonic in.
// Currently, only english is supported though.
// Currently, only English is supported though.
// Find a list of all supported languages in the BIP 39 spec (word lists).
type Language int

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/adr-031-msg-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ that `Msg` return types be captured using a protobuf extension field, ex:
package cosmos.gov;
message MsgSubmitProposal
option (cosmos_proto.msg_return) = uint64;
option (cosmos_proto.msg_return) = "uint64";
string delegator_address = 1;
string validator_address = 2;
repeated sdk.Coin amount = 3;
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/adr-033-protobuf-inter-module-comm.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ own account. These permissions are actually stored as a `[]string` array on the
However, these permissions don’t really do much. They control what modules can be referenced in the `MintCoins`,
`BurnCoins` and `DelegateCoins***` methods, but for one there is no unique object capability token that controls access —
just a simple string. So the `x/upgrade` module could mint tokens for the `x/staking` module simple by calling
`MintCoins(staking)`. Furthermore, all modules which have access to these keeper methods, also have access to
`MintCoins("staking")`. Furthermore, all modules which have access to these keeper methods, also have access to
`SetBalance` negating any other attempt at OCAPs and breaking even basic object-oriented encapsulation.

## Decision
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/adr-036-arbitrary-signature.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The aim is being able to sign arbitrary messages, even using Ledger or similar H

As a result signed messages should look roughly like Cosmos SDK messages but **must not** be a valid on-chain transaction. `chain-id`, `account_number` and `sequence` can all be assigned invalid values.

Cosmos SDK 0.40 also introduces a concept of auth_info this can specify SIGN_MODES.
Cosmos SDK 0.40 also introduces a concept of "auth_info" this can specify SIGN_MODES.

A spec should include an `auth_info` that supports SIGN_MODE_DIRECT and SIGN_MODE_LEGACY_AMINO.

Expand All @@ -43,7 +43,7 @@ An offchain transaction follows these rules:

* the memo must be empty
* nonce, sequence number must be equal to 0
* chain-id must be equal to “”
* chain-id must be equal to ""
* fee gas must be equal to 0
* fee amount must be an empty array

Expand Down
2 changes: 1 addition & 1 deletion indexer/postgres/tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
cosmossdk.io/schema/testing v0.0.1
github.com/fergusstrange/embedded-postgres v1.30.0
github.com/hashicorp/consul/sdk v0.16.1
github.com/jackc/pgx/v5 v5.7.1
github.com/jackc/pgx/v5 v5.7.2
github.com/stretchr/testify v1.10.0
gotest.tools/v3 v3.5.1
)
Expand Down
4 changes: 2 additions & 2 deletions indexer/postgres/tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs=
github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA=
github.com/jackc/pgx/v5 v5.7.2 h1:mLoDLV6sonKlvjIEsV56SkWNCnuNv531l94GaIzO+XI=
github.com/jackc/pgx/v5 v5.7.2/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
Expand Down
2 changes: 1 addition & 1 deletion runtime/v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (m *MM[T]) TxValidators() func(ctx context.Context, tx T) error {
// As an app developer, if you wish to skip running InitGenesis for your new
// module "foo", you need to manually pass a `fromVM` argument to this function
// foo's module version set to its latest ConsensusVersion. That way, the diff
// between the function's `fromVM` and `udpatedVM` will be empty, hence not
// between the function's `fromVM` and `updatedVM` will be empty, hence not
// running anything for foo.
//
// Example:
Expand Down
10 changes: 9 additions & 1 deletion server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,20 @@ func (c *consensus[T]) maybeHandleExternalServices(ctx context.Context, req *abc
if strings.HasPrefix(req.Path, "/cosmos.tx.v1beta1.Service") {
rpcClient, _ := client.NewClientFromNode(c.cfg.AppTomlConfig.Address)

txConfig := authtx.NewTxConfig(
c.appCodecs.AppCodec,
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().AddressCodec(),
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().ValidatorAddressCodec(),
authtx.DefaultSignModes,
)

// init simple client context
clientCtx := client.Context{}.
WithLegacyAmino(c.appCodecs.LegacyAmino.(*codec.LegacyAmino)).
WithCodec(c.appCodecs.AppCodec).
WithNodeURI(c.cfg.AppTomlConfig.Address).
WithClient(rpcClient)
WithClient(rpcClient).
WithTxConfig(txConfig)

txService := txServer[T]{
clientCtx: clientCtx,
Expand Down
2 changes: 1 addition & 1 deletion server/v2/stf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ type (
)
```

THe wrappGasMeter is used in order to consume gas. Application developers can seamlsessly replace the gas meter with their own implementation in order to customize consumption of gas.
THe wrapGasMeter is used in order to consume gas. Application developers can seamlsessly replace the gas meter with their own implementation in order to customize consumption of gas.
2 changes: 1 addition & 1 deletion simapp/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/cometbft/cometbft v1.0.0
// this version is not used as it is always replaced by the latest Cosmos SDK version
github.com/cosmos/cosmos-sdk v0.53.0
github.com/jackc/pgx/v5 v5.7.1
github.com/jackc/pgx/v5 v5.7.2
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions simapp/v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs=
github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA=
github.com/jackc/pgx/v5 v5.7.2 h1:mLoDLV6sonKlvjIEsV56SkWNCnuNv531l94GaIzO+XI=
github.com/jackc/pgx/v5 v5.7.2/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94=
Expand Down
2 changes: 1 addition & 1 deletion tests/systemtests/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ func TestTxDecodeAmino_GRPC(t *testing.T) {
}{
{"nil request", nil, true, "request cannot be nil"},
{"empty request", &tx.TxDecodeAminoRequest{}, true, "invalid empty tx bytes"},
{"invalid tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: invalidTxBytes}, true, "invalid request"},
{"invalid tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: invalidTxBytes}, true, "unmarshal to legacytx.StdTx failed"},
{"valid request with tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: encodedTx}, false, ""},
}

Expand Down
2 changes: 1 addition & 1 deletion testutil/sims/app_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func GenesisStateWithValSet(
// add bonded amount to bonded pool module account
balances = append(balances, banktypes.Balance{
Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(),
Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)},
Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt.MulRaw(int64(len(delegations))))},
})

// update total supply
Expand Down
4 changes: 2 additions & 2 deletions types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ func (m *Manager) assertNoForgottenModules(setOrderFnName string, moduleNames []
//
// Internally, RunMigrations will perform the following steps:
// - create an `updatedVM` VersionMap of module with their latest ConsensusVersion
// - make a diff of `fromVM` and `udpatedVM`, and for each module:
// - make a diff of `fromVM` and `updatedVM`, and for each module:
// - if the module's `fromVM` version is less than its `updatedVM` version,
// then run in-place store migrations for that module between those versions.
// - if the module does not exist in the `fromVM` (which means that it's a new module,
Expand All @@ -643,7 +643,7 @@ func (m *Manager) assertNoForgottenModules(setOrderFnName string, moduleNames []
// As an app developer, if you wish to skip running InitGenesis for your new
// module "foo", you need to manually pass a `fromVM` argument to this function
// foo's module version set to its latest ConsensusVersion. That way, the diff
// between the function's `fromVM` and `udpatedVM` will be empty, hence not
// between the function's `fromVM` and `updatedVM` will be empty, hence not
// running anything for foo.
//
// Example:
Expand Down
4 changes: 2 additions & 2 deletions x/bank/v2/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (suite *KeeperTestSuite) SetupTest() {
suite.addressCodec = ac
}

func (suite *KeeperTestSuite) TestSendCoins_Acount_To_Account() {
func (suite *KeeperTestSuite) TestSendCoins_Account_To_Account() {
ctx := suite.ctx
require := suite.Require()
balances := sdk.NewCoins(newFooCoin(100), newBarCoin(50))
Expand All @@ -110,7 +110,7 @@ func (suite *KeeperTestSuite) TestSendCoins_Acount_To_Account() {
require.Equal(acc1BarBalance.Amount, math.NewInt(10))
}

func (suite *KeeperTestSuite) TestSendCoins_Acount_To_Module() {
func (suite *KeeperTestSuite) TestSendCoins_Account_To_Module() {
ctx := suite.ctx
require := suite.Require()
balances := sdk.NewCoins(newFooCoin(100), newBarCoin(50))
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcMethod: "DelegationRewards",
Use: "rewards-by-validator <delegator-addr> <validator-addr>",
Short: "Query all distribution delegator from a particular validator",
Example: fmt.Sprintf("$ %s query distribution rewards [delegator-address] [validator-address]", version.AppName),
Example: fmt.Sprintf("$ %s query distribution rewards-by-validator [delegator-address] [validator-address]", version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "delegator_address"},
{ProtoField: "validator_address"},
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ onValidatorBonded(address sdk.ValAddress)
IndexOffset : 0,
JailedUntil : time.Unix(0, 0),
Tombstone : false,
MissedBloskCounter : 0
MissedBlocksCounter : 0
} else {
signingInfo.StartHeight = CurrentHeight
}
Expand Down
1 change: 1 addition & 0 deletions x/staking/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Validators",
Use: "validators",
Short: "Query for all validators",
Long: "Query details about all validators on a network.",
},
Expand Down

0 comments on commit da593aa

Please sign in to comment.