Skip to content

Commit

Permalink
feat: add sender attribute to wasm storage events
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Aug 21, 2024
1 parent 76200f8 commit 434c98e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

This file describes the process for contributing to `seda-chain`.


## Starting

First and foremost, [fork](https://github.com/sedaprotocol/seda-chain/fork) the
repository. Then please read the [developing instructions](DEVELOPING.md) for
setting up your environment.


## Commits

Your commits must follow specific guidelines.
Expand All @@ -23,16 +25,18 @@ Sign all commits with a GPG key. GitHub has extensive documentation on how to:
- [Sign](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
your commits.

### Convention
### Conventional Commits

All commits are to follow the
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard.
Commit messages should always be meaningful.


## Error Handling

If you already have an error you can return, just return it. If you would like
to add context to the error, use `errorsmod.Wrapf()`. For instance:
to add context to the error, use `errorsmod.Wrap()` or `errorsmod.Wrapf()`.
For instance:

```go
import (
Expand Down Expand Up @@ -64,10 +68,12 @@ func (m *MsgCreateVestingAccount) ValidateBasic() error {
}
```


## Formatting and Cleanliness

Please run `make lint` before making a commit to format the code.


## Creating a Pull Request

For creating the PR, please follow the instructions below.
Expand Down
2 changes: 2 additions & 0 deletions x/wasm-storage/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func (m msgServer) StoreDataRequestWasm(goCtx context.Context, msg *types.MsgSto
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeStoreDataRequestWasm,
sdk.NewAttribute(types.AttributeSender, msg.Sender),
sdk.NewAttribute(types.AttributeWasmHash, hashString),
),
)
Expand Down Expand Up @@ -106,6 +107,7 @@ func (m msgServer) StoreExecutorWasm(goCtx context.Context, msg *types.MsgStoreE
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeExecutorWasm,
sdk.NewAttribute(types.AttributeSender, msg.Sender),
sdk.NewAttribute(types.AttributeWasmHash, hashString),
),
)
Expand Down
1 change: 1 addition & 0 deletions x/wasm-storage/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ const (
EventTypeWasmExpiration = "wasm_expiration"

AttributeWasmHash = "wasm_hash"
AttributeSender = "sender"
)

0 comments on commit 434c98e

Please sign in to comment.