Skip to content

Commit

Permalink
fix(x/accounts/lockup): fix proto path (#22319)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Oct 21, 2024
1 parent 681366e commit 2711ece
Show file tree
Hide file tree
Showing 26 changed files with 1,120 additions and 1,112 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/e2e/accounts/lockup/continous_lockup_test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"cosmossdk.io/core/header"
"cosmossdk.io/math"
lockupaccount "cosmossdk.io/x/accounts/defaults/lockup"
"cosmossdk.io/x/accounts/defaults/lockup/types"
types "cosmossdk.io/x/accounts/defaults/lockup/v1"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/accounts/lockup/delayed_lockup_test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"cosmossdk.io/core/header"
"cosmossdk.io/math"
lockupaccount "cosmossdk.io/x/accounts/defaults/lockup"
"cosmossdk.io/x/accounts/defaults/lockup/types"
types "cosmossdk.io/x/accounts/defaults/lockup/v1"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/accounts/lockup/periodic_lockup_test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"cosmossdk.io/core/header"
"cosmossdk.io/math"
lockupaccount "cosmossdk.io/x/accounts/defaults/lockup"
"cosmossdk.io/x/accounts/defaults/lockup/types"
types "cosmossdk.io/x/accounts/defaults/lockup/v1"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/accounts/lockup/permanent_lockup_test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"cosmossdk.io/core/header"
"cosmossdk.io/math"
lockupaccount "cosmossdk.io/x/accounts/defaults/lockup"
"cosmossdk.io/x/accounts/defaults/lockup/types"
types "cosmossdk.io/x/accounts/defaults/lockup/v1"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/accounts/lockup/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"cosmossdk.io/core/transaction"
"cosmossdk.io/simapp"
"cosmossdk.io/x/accounts/defaults/lockup/types"
types "cosmossdk.io/x/accounts/defaults/lockup/v1"
"cosmossdk.io/x/bank/testutil"

"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
Expand Down
34 changes: 17 additions & 17 deletions x/accounts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ It's crucial to understand that an account's state is isolated. This means:

For example, consider two accounts of type Counter:

- One located at address "cosmos123"
- Another at address "cosmos456"
* One located at address "cosmos123"
* Another at address "cosmos456"

These accounts do not share the same collections.Item instance. Instead, each maintains its own separate state.

Expand All @@ -51,10 +51,10 @@ type Account struct {

Creating an account begins with defining its init message. This message is processed when an account is created, similar to:

- The `instantiate` method in a CosmWasm contract
- The `constructor` in an EVM contract
* The `instantiate` method in a CosmWasm contract
* The `constructor` in an EVM contract

For an account to be a valid `x/account` implementer, it must define both:
For an account to be a valid `x/accounts` implementer, it must define both:

1. An `Init` method
2. An init message
Expand Down Expand Up @@ -106,8 +106,8 @@ func (a Account) RegisterInitHandler(builder *accountstd.InitBuilder) {

Execute handlers are methods that an account can execute, defined as messages. These executions can be triggered:

- During block execution (not queries) through transactions
- During begin or end block
* During block execution (not queries) through transactions
* During begin or end block

To define an execute handler, we start by creating its proto message:

Expand Down Expand Up @@ -176,8 +176,8 @@ value and returning the new value in the response.

Query Handlers are read-only methods implemented by an account to expose information about itself. This information can be accessed by:

- External clients (e.g., CLI, wallets)
- Other modules and accounts within the system
* External clients (e.g., CLI, wallets)
* Other modules and accounts within the system

Query handlers can be invoked:

Expand Down Expand Up @@ -315,9 +315,9 @@ accountsKeeper, err := accounts.NewKeeper(

Choose the method that best fits your application structure.

### The accountsstd Package
### The accountstd Package

The `accountsstd` package provides utility functions for use within account init, execution, or query handlers. Key functions include:
The `accountstd` package provides utility functions for use within account init, execution, or query handlers. Key functions include:

1. `Whoami()`: Retrieves the address of the current account.
2. `Sender()`: Gets the address of the transaction sender (not available in queries).
Expand All @@ -340,9 +340,9 @@ This flexibility enables defining interfaces as common sets of messages and/or q

Example: Transaction Authentication

- We define a `MsgAuthenticate` message.
- Any account capable of handling `MsgAuthenticate` is considered to implement the `Authentication` interface.
- This approach allows for standardized interaction patterns across different account types.
* We define a `MsgAuthenticate` message.
* Any account capable of handling `MsgAuthenticate` is considered to implement the `Authentication` interface.
* This approach allows for standardized interaction patterns across different account types.

(Note: More details on the `Authentication` interface will be provided later.)

Expand Down Expand Up @@ -431,7 +431,7 @@ func (a Account) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) {

1. **Sender Verification**: Always verify that the sender is the x/accounts module. This prevents unauthorized accounts from triggering authentication.
2. **Authentication Safety**: Ensure your authentication mechanism is secure:
- Prevent replay attacks by making it impossible to reuse the same action with the same signature.
* Prevent replay attacks by making it impossible to reuse the same action with the same signature.

##### Implementation example

Expand Down Expand Up @@ -491,8 +491,8 @@ func (a Account) AuthRetroCompatibility(ctx context.Context, _ *authtypes.QueryL

### Usage Notes

- Implement this handler only for account types you want to expose via x/auth gRPC methods.
- The `info` field in the response can be nil if your account doesn't fit the `BaseAccount` structure.
* Implement this handler only for account types you want to expose via x/auth gRPC methods.
* The `info` field in the response can be nil if your account doesn't fit the `BaseAccount` structure.

## Genesis

Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/continuous_locking_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
collcodec "cosmossdk.io/collections/codec"
"cosmossdk.io/math"
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"cosmossdk.io/core/store"
"cosmossdk.io/log"
"cosmossdk.io/math"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/delayed_locking_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"cosmossdk.io/math"
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/delayed_locking_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"cosmossdk.io/core/store"
"cosmossdk.io/log"
"cosmossdk.io/math"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/lockup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
errorsmod "cosmossdk.io/errors"
"cosmossdk.io/math"
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"
banktypes "cosmossdk.io/x/bank/types"
distrtypes "cosmossdk.io/x/distribution/types"
stakingtypes "cosmossdk.io/x/staking/types"
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/lockup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"cosmossdk.io/core/store"
"cosmossdk.io/math"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/periodic_locking_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
errorsmod "cosmossdk.io/errors"
"cosmossdk.io/math"
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"cosmossdk.io/core/store"
"cosmossdk.io/log"
"cosmossdk.io/math"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/permanent_locking_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"cosmossdk.io/math"
"cosmossdk.io/x/accounts/accountstd"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"cosmossdk.io/core/store"
"cosmossdk.io/log"
"cosmossdk.io/math"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types"
lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package types
package v1

import (
"fmt"
Expand Down

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

Loading

0 comments on commit 2711ece

Please sign in to comment.