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

feat(x/accounts): wire x/accounts to simapp #18253

Merged
merged 43 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
222bbd7
tmp commit
Sep 26, 2023
d3a76c4
Merge remote-tracking branch 'origin/main' into tip/accounts/module
Oct 13, 2023
97f4d12
tmp
Oct 13, 2023
7fdd822
test rollback
Oct 13, 2023
2784b8a
Merge branch 'main' into tip/accounts/module
Oct 13, 2023
78e3c74
adapt interfaces
Oct 13, 2023
5e91277
rename simapp.AccountKeeper=>AuthKeeper
Oct 13, 2023
5818be6
proper wiring
Oct 13, 2023
df2b814
more adjustments
Oct 13, 2023
1f5ec83
finish wiring maybe
Oct 16, 2023
3d5a5fc
tmp
Oct 17, 2023
26d52f6
change init msg decoding
Oct 19, 2023
c9d47a6
add handler schema
Oct 19, 2023
919b33d
add schemas in grpc
Oct 19, 2023
350ef5a
more things
Oct 25, 2023
2dd30a7
minor refactor
Oct 25, 2023
c4282a9
all works apparently
Oct 25, 2023
1b376bf
lint
Oct 25, 2023
5d97973
Merge branch 'main' into tip/accounts/module
Oct 25, 2023
03d1492
post merge lint
Oct 25, 2023
87efff8
fix protos
Oct 25, 2023
1cfce44
address linting
Oct 25, 2023
0b7b866
fix and test again
Oct 26, 2023
06a02f7
Merge branch 'main' into tip/accounts/module
Oct 30, 2023
7ccfb8e
merge again
Oct 30, 2023
2cf02a4
add accounts to upgrades
Oct 30, 2023
b8c03d2
address pr reviews
Oct 30, 2023
d977173
add more docs
Oct 30, 2023
e1d9f6a
Merge branch 'main' into tip/accounts/module
Oct 30, 2023
72886e8
lint and tidy
Oct 30, 2023
ff0dcf9
more docs
Oct 30, 2023
e2c0ebf
add consensus versions to x/accounts
Nov 2, 2023
d6435db
Merge branch 'main' into tip/accounts/module
testinginprod Nov 2, 2023
ca09df7
update go mod
Nov 2, 2023
30cf96b
lint
Nov 2, 2023
fc7ecdc
Update x/accounts/internal/implementation/implementation.go
testinginprod Nov 2, 2023
cd993b6
docs
Nov 2, 2023
5ad7e23
try cleanup go.mod again
Nov 2, 2023
8a992d1
Update x/accounts/module.go
testinginprod Nov 2, 2023
2348ca7
Merge remote-tracking branch 'origin/main' into tip/accounts/module
Nov 3, 2023
c2e6f4f
finish merging main
Nov 3, 2023
ac8a779
fix merge conflict
Nov 3, 2023
3819541
move replace directive in the correct section
Nov 3, 2023
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
2,730 changes: 2,730 additions & 0 deletions api/cosmos/accounts/testing/counter/v1/counter.pulsar.go

Large diffs are not rendered by default.

2,843 changes: 2,813 additions & 30 deletions api/cosmos/accounts/v1/query.pulsar.go

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions api/cosmos/accounts/v1/query_grpc.pb.go

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

89 changes: 47 additions & 42 deletions api/cosmos/accounts/v1/tx.pulsar.go

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

34 changes: 34 additions & 0 deletions proto/cosmos/accounts/testing/counter/v1/counter.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
syntax = "proto3";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a test account protofile, to use for simd testing


package cosmos.accounts.testing.counter.v1;

// MsgInit defines a message which initializes the counter with a given amount.
message MsgInit {
// initial_value is the initial amount to set the counter to.
uint64 initial_value = 1;
}

// MsgInitResponse defines the MsgInit response type.
message MsgInitResponse {}

// MsgIncreaseCounter defines a message which increases the counter by a given amount.
message MsgIncreaseCounter {
// amount is the amount to increase the counter by.
uint64 amount = 1;
}

// MsgIncreaseCounterResponse defines the MsgIncreaseCounter response type.
// Returns the new counter value.
message MsgIncreaseCounterResponse {
// new_amount defines the new counter value after the increase.
uint64 new_amount = 1;
}

// QueryCounterRequest is used to query the counter value.
message QueryCounterRequest {}

// QueryCounterResponse returns the counter value.
message QueryCounterResponse {
// value defines the value of the counter.
uint64 value = 1;
}
41 changes: 41 additions & 0 deletions proto/cosmos/accounts/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ option go_package = "cosmossdk.io/x/accounts/v1";
service Query {
// AccountQuery runs an account query.
rpc AccountQuery(AccountQueryRequest) returns (AccountQueryResponse) {};
// Schema returns an x/account schema. Unstable.
rpc Schema(SchemaRequest) returns (SchemaResponse) {};
// AccountType returns the account type for an address.
rpc AccountType(AccountTypeRequest) returns (AccountTypeResponse) {};
}

// AccountQueryRequest is the request type for the Query/AccountQuery RPC
Expand All @@ -23,3 +27,40 @@ message AccountQueryResponse {
// response defines the query response of the account.
bytes response = 1;
}

// SchemaResponse is the response type for the Query/Schema RPC method.
message SchemaRequest {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are approximate schema definitions which represent the init/query/exec messages an account can process.

tac0turtle marked this conversation as resolved.
Show resolved Hide resolved
// account_type defines the account type to query the schema for.
string account_type = 1;
}

// SchemaResponse is the response type for the Query/Schema RPC method.
message SchemaResponse {
// Handler defines a schema descriptor for a handler.
// Where request and response are names that can be used to lookup the
// reflection descriptor.
message Handler {
// request is the request name
string request = 1;
// response is the response name
string response = 2;
}
// init_schema defines the schema descriptor for the Init account method.
Handler init_schema = 1;
// execute_handlers defines the schema descriptor for the Execute account method.
repeated Handler execute_handlers = 2;
// query_handlers defines the schema descriptor for the Query account method.
repeated Handler query_handlers = 3;
}

// AccountTypeRequest is the request type for the Query/AccountType RPC method.
message AccountTypeRequest {
// address defines the address to query the account type for.
string address = 1;
}

// AccountTypeResponse is the response type for the Query/AccountType RPC method.
message AccountTypeResponse {
// account_type defines the account type for the address.
string account_type = 1;
}
7 changes: 7 additions & 0 deletions proto/cosmos/accounts/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ package cosmos.accounts.v1;

option go_package = "cosmossdk.io/x/accounts/v1";

import "cosmos/msg/v1/msg.proto";

// Msg defines the Msg service for the x/accounts module.
service Msg {
option (cosmos.msg.v1.service) = true;

// Init creates a new account in the chain.
rpc Init(MsgInit) returns (MsgInitResponse);

Expand All @@ -15,6 +19,8 @@ service Msg {

// MsgInit defines the Create request type for the Msg/Create RPC method.
message MsgInit {
option (cosmos.msg.v1.signer) = "sender";

// sender is the address of the sender of this message.
string sender = 1;
// account_type is the type of the account to be created.
Expand All @@ -35,6 +41,7 @@ message MsgInitResponse {

// MsgExecute defines the Execute request type for the Msg/Execute RPC method.
message MsgExecute {
option (cosmos.msg.v1.signer) = "sender";
// sender is the address of the sender of this message.
string sender = 1;
// target is the address of the account to be executed.
Expand Down
Loading
Loading