Skip to content

Commit

Permalink
Remove granter
Browse files Browse the repository at this point in the history
  • Loading branch information
0Tech committed Oct 26, 2022
1 parent ea17c5a commit ae3f647
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 171 deletions.
2 changes: 0 additions & 2 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17122,7 +17122,6 @@ EventGrant is emitted on Msg/Grant

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `granter` | [string](#string) | | |
| `grantee` | [string](#string) | | the address of the grantee. |
| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | authorization granted. |

Expand Down Expand Up @@ -17154,7 +17153,6 @@ EventRevoke is emitted on Msg/Revoke

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `granter` | [string](#string) | | |
| `grantee` | [string](#string) | | address of the grantee. |
| `msg_type_url` | [string](#string) | | message type url for which an autorization is revoked. |

Expand Down
10 changes: 4 additions & 6 deletions proto/lbm/foundation/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,19 @@ message EventLeaveFoundation {

// EventGrant is emitted on Msg/Grant
message EventGrant {
string granter = 1;
// the address of the grantee.
string grantee = 2;
string grantee = 1;
// authorization granted.
google.protobuf.Any authorization = 3
google.protobuf.Any authorization = 2
[(cosmos_proto.accepts_interface) = "github.com/line/lbm-sdk/x/authz.Authorization"];
}

// EventRevoke is emitted on Msg/Revoke
message EventRevoke {
string granter = 1;
// address of the grantee.
string grantee = 2;
string grantee = 1;
// message type url for which an autorization is revoked.
string msg_type_url = 3;
string msg_type_url = 2;
}

// EventGovMint is an event emitted when the minter mint coins to the treasury.
Expand Down
212 changes: 55 additions & 157 deletions x/foundation/event.pb.go

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

6 changes: 0 additions & 6 deletions x/foundation/keeper/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ func (k Keeper) Grant(ctx sdk.Context, grantee sdk.AccAddress, authorization fou
return err
}

// TODO: remove granter from the event proto.
granter := foundation.ModuleName
if err := ctx.EventManager().EmitTypedEvent(&foundation.EventGrant{
Granter: granter,
Grantee: grantee.String(),
Authorization: any,
}); err != nil {
Expand All @@ -42,10 +39,7 @@ func (k Keeper) Revoke(ctx sdk.Context, grantee sdk.AccAddress, msgTypeURL strin
}
k.deleteAuthorization(ctx, grantee, msgTypeURL)

// TODO: remove granter from the event proto.
granter := foundation.ModuleName
if err := ctx.EventManager().EmitTypedEvent(&foundation.EventRevoke{
Granter: granter,
Grantee: grantee.String(),
MsgTypeUrl: msgTypeURL,
}); err != nil {
Expand Down

0 comments on commit ae3f647

Please sign in to comment.