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

Add block height to execution data #1680

Merged
merged 2 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
84 changes: 45 additions & 39 deletions execution/execution.pb.go

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

5 changes: 5 additions & 0 deletions protobuf/types/execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ message Execution {
string price = 14 [
(gogoproto.moretags) = 'hash:"name:14" validate:"coins"'
];

// blockHeight where the execution was included into blockchain.
int64 blockHeight = 15 [
(gogoproto.moretags) = 'hash:"-"'
NicolasMahe marked this conversation as resolved.
Show resolved Hide resolved
];
}
2 changes: 2 additions & 0 deletions x/execution/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreateExecution) (*executi
msg.Request.Tags,
msg.Request.ExecutorHash,
)
exec.BlockHeight = ctx.BlockHeight()
NicolasMahe marked this conversation as resolved.
Show resolved Hide resolved

store := ctx.KVStore(k.storeKey)
if store.Has(exec.Hash) {
return nil, fmt.Errorf("execution %q already exists", exec.Hash)
Expand Down