diff --git a/execution/execution.pb.go b/execution/execution.pb.go index 1c53e792c..70c7f5530 100644 --- a/execution/execution.pb.go +++ b/execution/execution.pb.go @@ -97,7 +97,9 @@ type Execution struct { // runner that should execute this execution. ExecutorHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,13,opt,name=executorHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"executorHash" hash:"name:13"` // price of running the exeuction. - Price string `protobuf:"bytes,14,opt,name=price,proto3" json:"price,omitempty" hash:"name:14" validate:"coins"` + Price string `protobuf:"bytes,14,opt,name=price,proto3" json:"price,omitempty" hash:"name:14" validate:"coins"` + // blockHeight where the execution was included into blockchain. + BlockHeight int64 `protobuf:"varint,15,opt,name=blockHeight,proto3" json:"blockHeight,omitempty" hash:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -135,44 +137,45 @@ func init() { func init() { proto.RegisterFile("execution.proto", fileDescriptor_776e2c5022e94aef) } var fileDescriptor_776e2c5022e94aef = []byte{ - // 577 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xad, 0xdb, 0xd4, 0xa9, 0x6f, 0xd2, 0x7c, 0xf9, 0x46, 0x42, 0xb2, 0x8a, 0x54, 0x5b, 0xc3, - 0x26, 0xd0, 0xd6, 0xa6, 0x29, 0xe5, 0xa7, 0x12, 0x02, 0x52, 0x8a, 0x40, 0x08, 0x09, 0xb9, 0x62, - 0xc3, 0x6e, 0x62, 0x4f, 0x9d, 0x51, 0x9b, 0x19, 0x6b, 0x66, 0x1c, 0xe8, 0xdb, 0xb0, 0xe4, 0x51, - 0xfa, 0x0c, 0x2c, 0x22, 0xc1, 0x23, 0xe4, 0x09, 0x90, 0xc7, 0x75, 0xeb, 0x14, 0x09, 0xa1, 0x2a,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3e, 0x8e, 0xaa, 0x16, 0xc4, 0xa0, 0x5d, - 0xbe, 0xdc, 0x42, 0x1a, 0x5f, 0xeb, 0x0b, 0xf3, 0xb5, 0x87, 0xa3, 0x39, 0x69, 0xf4, 0x0c, 0x56, - 0x33, 0xc9, 0x62, 0xea, 0x76, 0x8c, 0xad, 0x7b, 0xb3, 0xa9, 0xe7, 0xd5, 0x09, 0x8f, 0xea, 0x29, - 0xc6, 0x82, 0x71, 0x85, 0xa3, 0x92, 0xf1, 0xe0, 0x03, 0xd8, 0xe5, 0x6d, 0xa3, 0x16, 0x34, 0x3f, - 0xf1, 0x53, 0x2e, 0xbe, 0xf0, 0xee, 0x52, 0x51, 0x1c, 0x4a, 0x4a, 0x34, 0x4d, 0xba, 0x16, 0xea, - 0x00, 0xbc, 0xe3, 0x1f, 0xa5, 0x48, 0x25, 0x55, 0xaa, 0xbb, 0x8c, 0xd6, 0xc1, 0x39, 0x14, 0xe3, - 0xec, 0x8c, 0x16, 0xf0, 0x0a, 0x02, 0xb0, 0xdf, 0x10, 0x76, 0x46, 0x93, 0x6e, 0x63, 0xb0, 0x7f, - 0xf1, 0x73, 0x73, 0xe9, 0xfb, 0xaf, 0x4d, 0xeb, 0xf3, 0x3f, 0x2c, 0x78, 0xf5, 0xed, 0x1b, 0xda, - 0xe6, 0xa2, 0xf6, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x6c, 0x7b, 0xe0, 0x0f, 0x05, 0x00, - 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x5f, 0x4f, 0xdb, 0x3e, + 0x14, 0x25, 0xb4, 0xb4, 0xf4, 0xb6, 0x94, 0xfe, 0x2c, 0xfd, 0xa4, 0x88, 0x49, 0x24, 0xf2, 0x5e, + 0xb2, 0x01, 0xc9, 0x28, 0x63, 0x7f, 0x90, 0xa6, 0x6d, 0x65, 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0xab, 0x05, + 0x78, 0x67, 0x3f, 0x05, 0x00, 0x00, } func (this *Execution) Equal(that interface{}) bool { @@ -241,6 +244,9 @@ func (this *Execution) Equal(that interface{}) bool { if this.Price != that1.Price { return false } + if this.BlockHeight != that1.BlockHeight { + return false + } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index 55aa00508..71e203c25 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -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:"-"' + ]; } diff --git a/x/execution/internal/keeper/keeper.go b/x/execution/internal/keeper/keeper.go index 42af7a37b..73b152f33 100644 --- a/x/execution/internal/keeper/keeper.go +++ b/x/execution/internal/keeper/keeper.go @@ -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() + store := ctx.KVStore(k.storeKey) if store.Has(exec.Hash) { return nil, fmt.Errorf("execution %q already exists", exec.Hash)