From 49ab377932f5fd4b1c881501cc69098f3b2f3db1 Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Wed, 25 Mar 2020 13:14:16 +0700 Subject: [PATCH 1/6] Move setting the empty sid to service.New function --- service/service.go | 8 ++++++++ x/service/internal/keeper/keeper.go | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/service/service.go b/service/service.go index 805e1bf71..b67cb6d3a 100644 --- a/service/service.go +++ b/service/service.go @@ -9,6 +9,7 @@ import ( "github.com/tendermint/tendermint/crypto" ) +// New initializes a new Service. func New(sid, name, description string, configuration Service_Configuration, tasks []*Service_Task, events []*Service_Event, dependencies []*Service_Dependency, repository, source string) *Service { // create service srv := &Service{ @@ -26,6 +27,13 @@ func New(sid, name, description string, configuration Service_Configuration, tas // calculate and apply hash to service. srv.Hash = hash.Dump(srv) srv.Address = sdk.AccAddress(crypto.AddressHash(srv.Hash)) + + // set a sid if this one is empty (yes, after hash calculation..) + if srv.Sid == "" { + // make sure that sid doesn't have the same length with id. + srv.Sid = "_" + srv.Hash.String() + } + return srv } diff --git a/x/service/internal/keeper/keeper.go b/x/service/internal/keeper/keeper.go index 8684758f7..cf2358c6d 100644 --- a/x/service/internal/keeper/keeper.go +++ b/x/service/internal/keeper/keeper.go @@ -56,12 +56,6 @@ func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreate) (*servicepb.Servic return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "service %q already exists", srv.Hash) } - // TODO: the following test should be moved in New function - if srv.Sid == "" { - // make sure that sid doesn't have the same length with id. - srv.Sid = "_" + srv.Hash.String() - } - if err := srv.Validate(); err != nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) } From 0be8c7d76fc676047b005dcaa945cb117bef1cd9 Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Wed, 25 Mar 2020 13:48:34 +0700 Subject: [PATCH 2/6] add resource validation in their new function --- execution/execution.go | 5 +++-- execution/execution_test.go | 10 +++++----- instance/instance.go | 10 +++++++--- ownership/ownership.go | 19 +++++++++++++++++++ process/process.go | 4 ++-- runner/builder/builder.go | 18 ++++++++++-------- runner/runner.go | 5 +++-- service/service.go | 4 ++-- x/execution/internal/keeper/keeper.go | 5 ++++- x/instance/internal/keeper/keeper.go | 5 ++++- x/ownership/internal/keeper/keeper.go | 10 +++------- x/process/client/rest/query.go | 6 +++++- x/process/internal/keeper/keeper.go | 7 ++++++- x/process/internal/types/msg.go | 3 +-- x/runner/client/rest/query.go | 13 +++++++++++-- x/runner/internal/keeper/keeper.go | 6 +++++- x/service/client/rest/query.go | 6 +++++- x/service/internal/keeper/keeper.go | 9 ++++----- 18 files changed, 99 insertions(+), 46 deletions(-) create mode 100644 ownership/ownership.go diff --git a/execution/execution.go b/execution/execution.go index 64f0c6fe6..6b9716f07 100644 --- a/execution/execution.go +++ b/execution/execution.go @@ -2,13 +2,14 @@ package execution import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mesg-foundation/engine/ext/xvalidator" "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/protobuf/types" "github.com/tendermint/tendermint/crypto" ) // New returns a new execution. -func New(processHash, instanceHash, parentHash, eventHash hash.Hash, nodeKey, taskKey, price string, inputs *types.Struct, tags []string, executorHash hash.Hash) *Execution { +func New(processHash, instanceHash, parentHash, eventHash hash.Hash, nodeKey, taskKey, price string, inputs *types.Struct, tags []string, executorHash hash.Hash) (*Execution, error) { exec := &Execution{ ProcessHash: processHash, EventHash: eventHash, @@ -24,7 +25,7 @@ func New(processHash, instanceHash, parentHash, eventHash hash.Hash, nodeKey, ta } exec.Hash = hash.Dump(exec) exec.Address = sdk.AccAddress(crypto.AddressHash(exec.Hash)) - return exec + return exec, xvalidator.Struct(exec) } // Execute changes executions status to in progres. diff --git a/execution/execution_test.go b/execution/execution_test.go index f32b2b598..a0d4e9c76 100644 --- a/execution/execution_test.go +++ b/execution/execution_test.go @@ -19,7 +19,7 @@ func TestNewFromService(t *testing.T) { tags = []string{"tag"} ) - execution := New(nil, hash, parentHash, eventHash, "", taskKey, "", nil, tags, nil) + execution, _ := New(nil, hash, parentHash, eventHash, "", taskKey, "", nil, tags, nil) require.NotNil(t, execution) require.Equal(t, hash, execution.InstanceHash) require.Equal(t, parentHash, execution.ParentHash) @@ -31,7 +31,7 @@ func TestNewFromService(t *testing.T) { } func TestExecute(t *testing.T) { - e := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) + e, _ := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) require.NoError(t, e.Execute()) require.Equal(t, Status_InProgress, e.Status) require.Error(t, e.Execute()) @@ -39,7 +39,7 @@ func TestExecute(t *testing.T) { func TestComplete(t *testing.T) { var output types.Struct - e := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) + e, _ := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) e.Execute() require.NoError(t, e.Complete(&output)) require.Equal(t, Status_Completed, e.Status) @@ -49,7 +49,7 @@ func TestComplete(t *testing.T) { func TestFailed(t *testing.T) { err := errors.New("test") - e := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) + e, _ := New(nil, nil, nil, nil, "", "", "", nil, nil, nil) e.Execute() require.NoError(t, e.Fail(err)) require.Equal(t, Status_Failed, e.Status) @@ -61,7 +61,7 @@ func TestExecutionHash(t *testing.T) { ids := make(map[string]bool) f := func(instanceHash, parentHash, eventID []byte, taskKey string, tags []string) bool { - e := New(nil, instanceHash, parentHash, eventID, "", taskKey, "", nil, tags, nil) + e, _ := New(nil, instanceHash, parentHash, eventID, "", taskKey, "", nil, tags, nil) if ids[string(e.Hash)] { return false } diff --git a/instance/instance.go b/instance/instance.go index 4a167f261..d07bcaff2 100644 --- a/instance/instance.go +++ b/instance/instance.go @@ -1,12 +1,16 @@ package instance -import "github.com/mesg-foundation/engine/hash" +import ( + "github.com/mesg-foundation/engine/ext/xvalidator" + "github.com/mesg-foundation/engine/hash" +) -func New(serviceHash hash.Hash, envHash hash.Hash) *Instance { +// New returns a new Instance and validate it. +func New(serviceHash hash.Hash, envHash hash.Hash) (*Instance, error) { inst := &Instance{ ServiceHash: serviceHash, EnvHash: envHash, } inst.Hash = hash.Dump(inst) - return inst + return inst, xvalidator.Struct(inst) } diff --git a/ownership/ownership.go b/ownership/ownership.go new file mode 100644 index 000000000..713636653 --- /dev/null +++ b/ownership/ownership.go @@ -0,0 +1,19 @@ +package ownership + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mesg-foundation/engine/ext/xvalidator" + "github.com/mesg-foundation/engine/hash" +) + +// New returns a new ownership and validate it. +func New(owner string, resource Ownership_Resource, resourceHash hash.Hash, resourceAddress sdk.AccAddress) (*Ownership, error) { + own := &Ownership{ + Owner: owner, + Resource: resource, + ResourceHash: resourceHash, + ResourceAddress: resourceAddress, + } + own.Hash = hash.Dump(own) + return own, xvalidator.Struct(own) +} diff --git a/process/process.go b/process/process.go index 1c27814df..9d33ec1b0 100644 --- a/process/process.go +++ b/process/process.go @@ -11,7 +11,7 @@ import ( ) // New returns a new process and validate it. -func New(name string, nodes []*Process_Node, edges []*Process_Edge) *Process { +func New(name string, nodes []*Process_Node, edges []*Process_Edge) (*Process, error) { p := &Process{ Name: name, Nodes: nodes, @@ -19,7 +19,7 @@ func New(name string, nodes []*Process_Node, edges []*Process_Edge) *Process { } p.Hash = hash.Dump(p) p.Address = sdk.AccAddress(crypto.AddressHash(p.Hash)) - return p + return p, p.Validate() } // Validate returns an error if the process is invalid for whatever reason diff --git a/runner/builder/builder.go b/runner/builder/builder.go index ffa62479e..dde206e04 100644 --- a/runner/builder/builder.go +++ b/runner/builder/builder.go @@ -42,19 +42,21 @@ func (b *Builder) Create(req *api.CreateRunnerRequest) (*runnerpb.Runner, error) if err != nil { return nil, err } - instanceEnv := xos.EnvMergeSlices(srv.Configuration.Env, req.Env) envHash := hash.Dump(instanceEnv) - // TODO: should be done by instance or runner - instanceHash := hash.Dump(&instancepb.Instance{ - ServiceHash: srv.Hash, - EnvHash: envHash, - }) + + inst, err := instancepb.New(srv.Hash, envHash) + if err != nil { + return nil, err + } acc, err := b.mc.GetAccount() if err != nil { return nil, err } - expRunner := runnerpb.New(acc.GetAddress().String(), instanceHash) + expRunner, err := runnerpb.New(acc.GetAddress().String(), inst.Hash) + if err != nil { + return nil, err + } expRunnerHash := expRunner.Hash if runExisting, _ := b.mc.GetRunner(expRunnerHash); runExisting != nil { @@ -66,7 +68,7 @@ func (b *Builder) Create(req *api.CreateRunnerRequest) (*runnerpb.Runner, error) if err != nil { return nil, err } - _, err = start(b.container, srv, instanceHash, expRunnerHash, imageHash, instanceEnv, b.engineName, b.port) + _, err = start(b.container, srv, inst.Hash, expRunnerHash, imageHash, instanceEnv, b.engineName, b.port) if err != nil { return nil, err } diff --git a/runner/runner.go b/runner/runner.go index 9a1483b71..400a92479 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -2,17 +2,18 @@ package runner import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mesg-foundation/engine/ext/xvalidator" "github.com/mesg-foundation/engine/hash" "github.com/tendermint/tendermint/crypto" ) // New returns a new execution. -func New(owner string, instanceHash hash.Hash) *Runner { +func New(owner string, instanceHash hash.Hash) (*Runner, error) { run := &Runner{ Owner: owner, InstanceHash: instanceHash, } run.Hash = hash.Dump(run) run.Address = sdk.AccAddress(crypto.AddressHash(run.Hash)) - return run + return run, xvalidator.Struct(run) } diff --git a/service/service.go b/service/service.go index b67cb6d3a..2484b3b55 100644 --- a/service/service.go +++ b/service/service.go @@ -10,7 +10,7 @@ import ( ) // New initializes a new Service. -func New(sid, name, description string, configuration Service_Configuration, tasks []*Service_Task, events []*Service_Event, dependencies []*Service_Dependency, repository, source string) *Service { +func New(sid, name, description string, configuration Service_Configuration, tasks []*Service_Task, events []*Service_Event, dependencies []*Service_Dependency, repository, source string) (*Service, error) { // create service srv := &Service{ Sid: sid, @@ -34,7 +34,7 @@ func New(sid, name, description string, configuration Service_Configuration, tas srv.Sid = "_" + srv.Hash.String() } - return srv + return srv, srv.Validate() } // MainServiceKey is key for main service. diff --git a/x/execution/internal/keeper/keeper.go b/x/execution/internal/keeper/keeper.go index 8e4047ed2..3e0d54674 100644 --- a/x/execution/internal/keeper/keeper.go +++ b/x/execution/internal/keeper/keeper.go @@ -105,7 +105,7 @@ func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreate) (*executionpb.Exec return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "signer is not the execution's executor") } - exec := executionpb.New( + exec, err := executionpb.New( msg.ProcessHash, run.InstanceHash, msg.ParentHash, @@ -117,6 +117,9 @@ func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreate) (*executionpb.Exec msg.Tags, msg.ExecutorHash, ) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) + } // check if exec already exists store := ctx.KVStore(k.storeKey) diff --git a/x/instance/internal/keeper/keeper.go b/x/instance/internal/keeper/keeper.go index badeb37c8..890185b63 100644 --- a/x/instance/internal/keeper/keeper.go +++ b/x/instance/internal/keeper/keeper.go @@ -37,7 +37,10 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) FetchOrCreate(ctx sdk.Context, serviceHash hash.Hash, envHash hash.Hash) (*instance.Instance, error) { store := ctx.KVStore(k.storeKey) - inst := instance.New(serviceHash, envHash) + inst, err := instance.New(serviceHash, envHash) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) + } if !store.Has(inst.Hash) { value, err := k.cdc.MarshalBinaryLengthPrefixed(inst) diff --git a/x/ownership/internal/keeper/keeper.go b/x/ownership/internal/keeper/keeper.go index 0f9a2495f..43d816adb 100644 --- a/x/ownership/internal/keeper/keeper.go +++ b/x/ownership/internal/keeper/keeper.go @@ -65,14 +65,10 @@ func (k Keeper) Set(ctx sdk.Context, owner sdk.AccAddress, resourceHash hash.Has return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "resource %s:%q already has an owner", resource, resourceHash) } - // TODO: should be moved to a new function - own = &ownership.Ownership{ - Owner: owner.String(), - Resource: resource, - ResourceHash: resourceHash, - ResourceAddress: resourceAddress, + own, err = ownership.New(owner.String(), resource, resourceHash, resourceAddress) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) } - own.Hash = hash.Dump(own) data, err := k.cdc.MarshalBinaryLengthPrefixed(own) if err != nil { diff --git a/x/process/client/rest/query.go b/x/process/client/rest/query.go index 68b428518..a1ac1ca0e 100644 --- a/x/process/client/rest/query.go +++ b/x/process/client/rest/query.go @@ -116,7 +116,11 @@ func queryHashHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { return } - proc := process.New(req.Name, req.Nodes, req.Edges) + proc, err := process.New(req.Name, req.Nodes, req.Edges) + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } rest.PostProcessResponse(w, cliCtx, proc.Hash.String()) } diff --git a/x/process/internal/keeper/keeper.go b/x/process/internal/keeper/keeper.go index 6a7b6e76f..b8cb903bf 100644 --- a/x/process/internal/keeper/keeper.go +++ b/x/process/internal/keeper/keeper.go @@ -45,7 +45,12 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // Create creates a new process. func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreate) (*processpb.Process, error) { store := ctx.KVStore(k.storeKey) - p := process.New(msg.Name, msg.Nodes, msg.Edges) + + p, err := process.New(msg.Name, msg.Nodes, msg.Edges) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) + } + if store.Has(p.Hash) { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "process %q already exists", p.Hash) } diff --git a/x/process/internal/types/msg.go b/x/process/internal/types/msg.go index 30030ab87..37eecf7ca 100644 --- a/x/process/internal/types/msg.go +++ b/x/process/internal/types/msg.go @@ -22,8 +22,7 @@ func (msg MsgCreate) ValidateBasic() error { if err := xvalidator.Struct(msg); err != nil { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } - p := processpb.New(msg.Name, msg.Nodes, msg.Edges) - if err := p.Validate(); err != nil { + if _, err := processpb.New(msg.Name, msg.Nodes, msg.Edges); err != nil { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) } return nil diff --git a/x/runner/client/rest/query.go b/x/runner/client/rest/query.go index 9c8f09463..d9c642a59 100644 --- a/x/runner/client/rest/query.go +++ b/x/runner/client/rest/query.go @@ -145,8 +145,17 @@ func queryHashHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { } envHash := hash.Dump(xos.EnvMergeSlices(srv.Configuration.Env, req.Env)) - inst := instance.New(req.ServiceHash, envHash) - run := runner.New(req.Address, inst.Hash) + inst, err := instance.New(req.ServiceHash, envHash) + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } + + run, err := runner.New(req.Address, inst.Hash) + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } res := HashResponse{ RunnerHash: run.Hash, diff --git a/x/runner/internal/keeper/keeper.go b/x/runner/internal/keeper/keeper.go index ec17a094e..9db72eb8b 100644 --- a/x/runner/internal/keeper/keeper.go +++ b/x/runner/internal/keeper/keeper.go @@ -45,7 +45,11 @@ func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreate) (*runner.Runner, e return nil, err } - r := runner.New(msg.Owner.String(), inst.Hash) + r, err := runner.New(msg.Owner.String(), inst.Hash) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) + } + if store.Has(r.Hash) { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "runner %q already exists", r.Hash) } diff --git a/x/service/client/rest/query.go b/x/service/client/rest/query.go index 3b06b44b3..012a0c127 100644 --- a/x/service/client/rest/query.go +++ b/x/service/client/rest/query.go @@ -96,7 +96,7 @@ func queryHashHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { return } - srv := service.New( + srv, err := service.New( req.Sid, req.Name, req.Description, @@ -107,6 +107,10 @@ func queryHashHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { req.Repository, req.Source, ) + if err != nil { + rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) + return + } rest.PostProcessResponse(w, cliCtx, srv.Hash.String()) } diff --git a/x/service/internal/keeper/keeper.go b/x/service/internal/keeper/keeper.go index cf2358c6d..28063ffa7 100644 --- a/x/service/internal/keeper/keeper.go +++ b/x/service/internal/keeper/keeper.go @@ -39,7 +39,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreate) (*servicepb.Service, error) { store := ctx.KVStore(k.storeKey) // create service - srv := servicepb.New( + srv, err := servicepb.New( msg.Sid, msg.Name, msg.Description, @@ -50,16 +50,15 @@ func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreate) (*servicepb.Servic msg.Repository, msg.Source, ) + if err != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) + } // check if service already exists. if store.Has(srv.Hash) { return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "service %q already exists", srv.Hash) } - if err := srv.Validate(); err != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, err.Error()) - } - if _, err := k.ownershipKeeper.Set(ctx, msg.Owner, srv.Hash, ownershippb.Ownership_Service, srv.Address); err != nil { return nil, err } From 417e0cc489f9ae4781c335da5be0ce2e31b2789e Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Wed, 25 Mar 2020 14:41:12 +0700 Subject: [PATCH 3/6] add missing validation tags to protobuf types --- event/event.pb.go | 44 ++++----- execution/execution.pb.go | 120 +++++++++++------------ instance/instance.pb.go | 29 +++--- ownership/ownership.pb.go | 62 ++++++------ process/process.pb.go | 167 +++++++++++++++++---------------- protobuf/types/event.proto | 2 +- protobuf/types/execution.proto | 22 ++--- protobuf/types/instance.proto | 5 +- protobuf/types/ownership.proto | 11 ++- protobuf/types/process.proto | 12 +-- protobuf/types/runner.proto | 8 +- runner/runner.pb.go | 51 +++++----- 12 files changed, 273 insertions(+), 260 deletions(-) diff --git a/event/event.pb.go b/event/event.pb.go index 0611fe17e..3aff698de 100644 --- a/event/event.pb.go +++ b/event/event.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Event represents a single event run in engine. type Event struct { // Hash is a unique hash to identify event. - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` // instanceHash is hash of instance that can proceed an execution. InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required,hash"` // key is the key of the event. @@ -69,25 +69,25 @@ func init() { func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 320 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0x41, 0x4b, 0xfb, 0x30, - 0x18, 0xc6, 0xd7, 0x6d, 0xff, 0x3f, 0x9a, 0xcd, 0x83, 0x05, 0xa1, 0x4c, 0xb0, 0x25, 0x07, 0x1d, - 0xb8, 0x25, 0xb2, 0x79, 0x1a, 0x82, 0x50, 0x10, 0x3c, 0x77, 0x37, 0xc1, 0x43, 0xd6, 0xbe, 0x6b, - 0x83, 0x36, 0xa9, 0x4d, 0x3a, 0xd8, 0xd1, 0x6f, 0xb7, 0xcf,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x6a, 0x7f, 0xb4, 0x83, 0x99, 0xfe, 0x88, 0x29, 0x4a, 0x2e, 0x34, 0x53, 0x31, 0xe7, 0x38, - 0x32, 0x61, 0xf7, 0x0a, 0x75, 0x13, 0xa6, 0x99, 0xd7, 0x0d, 0x9c, 0x61, 0x6f, 0x72, 0x44, 0x6c, - 0x05, 0x9f, 0x7b, 0x25, 0x73, 0xbb, 0xd1, 0xf0, 0xb0, 0xa9, 0xfd, 0x83, 0x1d, 0xf6, 0x25, 0x8e, - 0x6c, 0x2a, 0x1c, 0x6f, 0x5e, 0x4f, 0x5a, 0x77, 0x67, 0xbf, 0x7f, 0xd6, 0xd6, 0xbc, 0xf8, 0x6f, - 0xc1, 0xd3, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x9b, 0xad, 0xff, 0xf6, 0x01, 0x00, 0x00, + // 319 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0xd7, 0x6d, 0x0a, 0x66, 0xf3, 0x60, 0x41, 0x28, 0x13, 0x6c, 0xcd, 0x41, 0x07, 0x6e, + 0x89, 0x6c, 0x9e, 0x86, 0xa7, 0x82, 0xe0, 0x79, 0x5e, 0x44, 0xf0, 0x90, 0xb5, 0x6f, 0x6d, 0x70, + 0x4d, 0x6a, 0x93, 0x0e, 0x76, 0xf4, 0xdb, 0xed, 0x33, 0x78, 0x28, 0xf8, 0x15, 0x7a, 0xf5, 0x22, + 0xc9, 0x54, 0x26, 0x88, 0x82, 0xb7, 0xbc, 0xbc, 0xfc, 0x7f, 0x3f, 0xf2, 0x1e, 0xea, 0xc0, 0x12, + 0x84, 0x26, 0x79, 0x21, 0xb5, 0x74, 0x51, 0x06, 0x2a, 0x21, 0x7a, 0x95, 0x83, 0xea, 0xe1, 0x44, + 0x26, 0x92, 0xda, 0xfb, 0x59, 0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95, 0xbf, 0xbf, 0xc5, 0xbe, 0xc4, 0x53, + 0x9b, 0x0a, 0x87, 0xeb, 0xd7, 0xe3, 0xc6, 0xfd, 0xd9, 0xdf, 0x9f, 0xb5, 0xfb, 0x9f, 0xed, 0x5a, + 0xf0, 0xf8, 0x3d, 0x00, 0x00, 0xff, 0xff, 0x53, 0x5c, 0x1b, 0x1f, 0x0f, 0x02, 0x00, 0x00, } diff --git a/execution/execution.pb.go b/execution/execution.pb.go index 2e3a4d285..62fe59473 100644 --- a/execution/execution.pb.go +++ b/execution/execution.pb.go @@ -71,19 +71,19 @@ func (Status) EnumDescriptor() ([]byte, []int) { // Execution represents a single execution run in engine. type Execution struct { // Hash is a unique hash to identify execution. - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` // parentHash is the unique hash of parent execution. // if execution is triggered by another one, // dependency execution considered as the parent. - ParentHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=parentHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"parentHash" hash:"name:2"` + ParentHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=parentHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"parentHash" hash:"name:2" validate:"omitempty,hash"` // eventHash is unique event hash. - EventHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=eventHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"eventHash" hash:"name:3"` + EventHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=eventHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"eventHash" hash:"name:3" validate:"omitempty,hash"` // Status is the current status of execution. - Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=mesg.types.Status" json:"status,omitempty" hash:"-"` + Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=mesg.types.Status" json:"status,omitempty" hash:"-" validate:"required"` // instanceHash is hash of the instance that can proceed an execution - InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,5,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:5"` + InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,5,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:5" validate:"required,hash"` // taskKey is the key of the task of this execution. - TaskKey string `protobuf:"bytes,6,opt,name=taskKey,proto3" json:"taskKey,omitempty" hash:"name:6"` + TaskKey string `protobuf:"bytes,6,opt,name=taskKey,proto3" json:"taskKey,omitempty" hash:"name:6" validate:"required,printascii"` // inputs data of the execution. Inputs *types.Struct `protobuf:"bytes,7,opt,name=inputs,proto3" json:"inputs,omitempty" hash:"name:7"` // outputs are the returned data of successful execution. @@ -93,11 +93,11 @@ type Execution struct { // tags are optionally associated with execution by the user. Tags []string `protobuf:"bytes,10,rep,name=tags,proto3" json:"tags,omitempty" hash:"name:10" validate:"dive,printascii"` // processHash is the unique hash of the process associated to this execution. - ProcessHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,11,opt,name=processHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"processHash" hash:"name:11"` + ProcessHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,11,opt,name=processHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"processHash" hash:"name:11" validate:"omitempty,hash"` // node key of the process. NodeKey string `protobuf:"bytes,12,opt,name=nodeKey,proto3" json:"nodeKey,omitempty" hash:"name:12"` // 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"` + 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" validate:"required,hash"` // price of running the exeuction. 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. @@ -105,7 +105,7 @@ type Execution struct { // list of emitters of this execution. Emitters []*Execution_Emitter `protobuf:"bytes,16,rep,name=emitters,proto3" json:"emitters,omitempty" hash:"-" validate:"dive"` // The address of the execution. - Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,17,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-" validate:"accaddress"` + Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,17,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-" validate:"required,accaddress"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -138,9 +138,9 @@ var xxx_messageInfo_Execution proto.InternalMessageInfo // Emitter is a runner that proposed an execution. type Execution_Emitter struct { // Emitter's hash. - RunnerHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=runnerHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"runnerHash" hash:"-" validate:"hash"` + RunnerHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=runnerHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"runnerHash" hash:"-" validate:"required,hash"` // Block height when this emitter proposed the execution. - BlockHeight int64 `protobuf:"varint,2,opt,name=blockHeight,proto3" json:"blockHeight,omitempty" hash:"-"` + BlockHeight int64 `protobuf:"varint,2,opt,name=blockHeight,proto3" json:"blockHeight,omitempty" hash:"-" validate:"required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -179,53 +179,57 @@ func init() { func init() { proto.RegisterFile("execution.proto", fileDescriptor_776e2c5022e94aef) } var fileDescriptor_776e2c5022e94aef = []byte{ - // 728 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x6e, 0xd3, 0x48, - 0x14, 0xae, 0x9b, 0x34, 0x3f, 0x27, 0x69, 0x9a, 0x8e, 0xb4, 0x92, 0xd5, 0xdd, 0xad, 0xad, 0xd9, - 0x9b, 0xec, 0xb6, 0x71, 0xb6, 0x29, 0xe5, 0xa7, 0x12, 0x82, 0x06, 0x8a, 0x8a, 0x90, 0xa0, 0x72, - 0x84, 0x90, 0xb8, 0x73, 0xec, 0xa9, 0x33, 0x4a, 0x32, 0x63, 0x79, 0xc6, 0x85, 0xbe, 0x11, 0xe2, - 0x3d, 0x90, 0xfa, 0x0c, 0x5c, 0x58, 0x82, 0x47, 0xc8, 0x25, 0x57, 0xc8, 0xe3, 0x38, 0x75, 0x42, - 0x05, 0xa8, 0xea, 0x55, 0x32, 0x3e, 0xe7, 0xfb, 0xce, 0x77, 0xbe, 0xe3, 0x39, 0x86, 0x0d, 0xf2, - 0x9e, 0xb8, 0x91, 0xa4, 0x9c, 0x59, 0x41, 0xc8, 0x25, 0x47, 0x30, 0x21, 0xc2, 0xb7, 0xe4, 0x45, - 0x40, 0xc4, 0x16, 0xf6, 0xb9, 0xcf, 0x3b, 0xea, 0xf9, 0x20, 0x3a, 0xeb, 0x24, 0x27, 0x75, 0x50, - 0xff, 0xd2, 0xfc, 0xad, 0x3f, 0xe7, 0x61, 0x85, 0xe9, 0x08, 0x19, 0x46, 0xae, 0x4c, 0x83, 0xf8, - 0x53, 0x0d, 0xaa, 0xc7, 0x59, 0x01, 0xd4, 0x87, 0xe2, 0xd0, 0x11, 0x43, 0x5d, 0x33, 0xb5, 0x56, - 0xbd, 0xf7, 0xe8, 0x32, 0x36, 0x56, 0x3e, 0xc7, 0xc6, 0x8e, 0x4f, 0xe5, 0x30, 0x1a, 0x58, 0x2e, - 0x9f, 0x74, 0x92, 0xda, 0xed, 0x33, 0x1e, 0x31, 0xcf, 0x49, 0x10, 0x1d, 0xc2, 0x7c, 0xca, 0x48, - 0x27, 0x41, 0x59, 0x27, 0x8e, 0x18, 0x4e, 0x63, 0xa3, 0x92, 0x1c, 0x0e, 0x71, 0x1b, 0xdb, 0x8a, - 0x0c, 0x79, 0x00, 0x81, 0x13, 0x12, 0x26, 0x93, 0xb8, 0xbe, 0xaa, 0xa8, 0x9f, 0xde, 0x8c, 0x7a, - 0x3d, 0xa5, 0x66, 0xce, 0x84, 0x1c, 0x76, 0xb1, 0x9d, 0xe3, 0x45, 0x03, 0xa8, 0x92, 0xf3, 0xac, - 0x48, 0xe1, 0xb6, 0x8a, 0xec, 0x63, 0xfb, 0x8a, 0x16, 0xdd, 0x87, 0x92, 0x90, 0x8e, 0x8c, 0x84, - 0x5e, 0x34, 0xb5, 0x56, 0xa3, 0x8b, 0xac, 0xab, 0x51, 0x58, 0x7d, 0x15, 0xe9, 0xd5, 0x17, 0x1c, - 0x98, 0xe5, 0xa3, 0x21, 0xd4, 0x29, 0x13, 0xd2, 0x61, 0x2e, 0x51, 0x02, 0xd7, 0x6e, 0x4b, 0xe0, - 0x01, 0xb6, 0x17, 0x98, 0xd1, 0x0e, 0x94, 0xa5, 0x23, 0x46, 0x2f, 0xc8, 0x85, 0x5e, 0x32, 0xb5, - 0x56, 0xb5, 0xb7, 0xb9, 0x84, 0xb8, 0x8b, 0xed, 0x2c, 0x03, 0x3d, 0x86, 0x12, 0x65, 0x41, 0x24, - 0x85, 0x5e, 0x36, 0xb5, 0x56, 0xad, 0xfb, 0x47, 0xda, 0x50, 0xf6, 0xc2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 0x2b, 0x1f, 0xbe, 0x6e, 0x6b, 0x6f, 0x7f, - 0xa3, 0xbd, 0xf9, 0x17, 0x6a, 0x50, 0x52, 0xf7, 0x7e, 0xff, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xe0, 0x8a, 0x48, 0x17, 0xb5, 0x06, 0x00, 0x00, + // 792 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xc7, 0xeb, 0xa6, 0x4d, 0x9a, 0x93, 0x34, 0x9b, 0x1d, 0x09, 0xc9, 0x2a, 0xcb, 0xda, 0x18, + 0x09, 0x0c, 0x34, 0xce, 0x36, 0x65, 0x41, 0x54, 0x42, 0xa2, 0x46, 0x8b, 0x96, 0x0f, 0xa1, 0x95, + 0x57, 0x08, 0x84, 0xf8, 0x90, 0x63, 0xcf, 0x3a, 0xa3, 0xc4, 0x33, 0x66, 0x66, 0x1c, 0xb6, 0x12, + 0x42, 0x82, 0xa7, 0xe1, 0x19, 0x78, 0x01, 0xf6, 0x19, 0xb8, 0xb0, 0x04, 0x8f, 0xe0, 0x4b, 0xae, + 0x90, 0xc7, 0x71, 0x3a, 0x41, 0x55, 0x40, 0x55, 0xf7, 0x2a, 0x99, 0xcc, 0xfc, 0xcf, 0x6f, 0xce, + 0xf9, 0x9f, 0x39, 0x81, 0x5b, 0xf8, 0x29, 0x8e, 0x72, 0x49, 0x18, 0xf5, 0x32, 0xce, 0x24, 0x43, + 0x90, 0x62, 0x91, 0x78, 0xf2, 0x22, 0xc3, 0xe2, 0xc8, 0x49, 0x58, 0xc2, 0xc6, 0xea, 0xf7, 0x69, + 0xfe, 0x64, 0x5c, 0xad, 0xd4, 0x42, 0x7d, 0xab, 0xcf, 0x1f, 0xbd, 0xb8, 0xde, 0x56, 0x9a, 0xb1, + 0x90, 0x3c, 0x8f, 0x64, 0xbd, 0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 0x7c, 0x06, 0xed, 0x7a, 0x50, 0xa2, 0x1e, + 0x74, 0x3e, 0xa7, 0x73, 0xca, 0x7e, 0xa0, 0xc3, 0x1d, 0xd4, 0x87, 0x83, 0x47, 0x9c, 0x65, 0x4c, + 0xe0, 0x78, 0x68, 0xa0, 0x01, 0xc0, 0x47, 0xf4, 0x11, 0x67, 0x49, 0x95, 0xfc, 0x70, 0x17, 0x1d, + 0x42, 0xf7, 0x03, 0x96, 0x66, 0x0b, 0x2c, 0x71, 0x3c, 0x6c, 0x21, 0x80, 0xf6, 0x87, 0x21, 0x59, + 0xe0, 0x78, 0xb8, 0xe7, 0xdf, 0x7f, 0xf6, 0xe7, 0xdd, 0x9d, 0x5f, 0xff, 0xba, 0x6b, 0x7c, 0xf5, + 0x3f, 0x72, 0x5f, 0xff, 0x2d, 0x4f, 0xdb, 0x6a, 0xa4, 0x9c, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, + 0xc3, 0xaf, 0x8f, 0x36, 0xaa, 0x07, 0x00, 0x00, } func (this *Execution) Equal(that interface{}) bool { diff --git a/instance/instance.pb.go b/instance/instance.pb.go index c32cd0924..0b659d5d2 100644 --- a/instance/instance.pb.go +++ b/instance/instance.pb.go @@ -25,9 +25,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Instance represents service's instance. type Instance struct { - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash"` - ServiceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=serviceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"serviceHash" hash:"name:2"` - EnvHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=envHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"envHash" hash:"name:3"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` + ServiceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=serviceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"serviceHash" hash:"name:2" validate:"required,hash"` + EnvHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=envHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"envHash" hash:"name:3" validate:"required,hash"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -64,22 +64,23 @@ func init() { func init() { proto.RegisterFile("instance.proto", fileDescriptor_fd22322185b2070b) } var fileDescriptor_fd22322185b2070b = []byte{ - // 226 bytes of a gzipped FileDescriptorProto + // 255 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0xcc, 0x2b, 0x2e, 0x49, 0xcc, 0x4b, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xca, 0x4d, 0x2d, 0x4e, 0xd7, 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x96, 0x52, 0x4a, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0x8b, 0x27, - 0x95, 0xa6, 0xe9, 0x83, 0x78, 0x60, 0x0e, 0x98, 0x05, 0x51, 0xaf, 0x34, 0x9b, 0x89, 0x8b, 0xc3, - 0x13, 0x6a, 0x84, 0x90, 0x3b, 0x17, 0x4b, 0x46, 0x62, 0x71, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, - 0x8f, 0x93, 0xf1, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0x6b, 0xa7, 0x67, 0x96, 0x64, 0x94, + 0x95, 0xa6, 0xe9, 0x83, 0x78, 0x60, 0x0e, 0x98, 0x05, 0x51, 0xaf, 0xf4, 0x89, 0x89, 0x8b, 0xc3, + 0x13, 0x6a, 0x84, 0x50, 0x0e, 0x17, 0x4b, 0x46, 0x62, 0x71, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, + 0x8f, 0x53, 0xc4, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0x6b, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x4c, 0xd7, 0x4d, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0xcd, 0x4b, 0xcf, 0xcc, 0x4b, 0xd5, 0x07, 0xe9, 0xd2, 0xf3, 0x48, - 0x2c, 0xce, 0x08, 0x02, 0x1b, 0x20, 0x94, 0xc6, 0xc5, 0x5d, 0x9c, 0x5a, 0x54, 0x96, 0x99, 0x9c, - 0x0a, 0x12, 0x94, 0x60, 0x02, 0x9b, 0xe7, 0x42, 0x86, 0x79, 0x9f, 0xee, 0xc9, 0xf3, 0x82, 0x38, - 0x56, 0x4a, 0x79, 0x89, 0xb9, 0xa9, 0x56, 0x46, 0x4a, 0x41, 0xc8, 0x06, 0x0b, 0xc5, 0x71, 0xb1, - 0xa7, 0xe6, 0x95, 0x81, 0xed, 0x60, 0xa6, 0x96, 0x1d, 0xc6, 0x4a, 0x41, 0x30, 0x43, 0x9d, 0x4c, - 0x4e, 0x3c, 0x94, 0x63, 0x58, 0xf1, 0x48, 0x8e, 0x31, 0x4a, 0x8b, 0xb0, 0x81, 0xb0, 0x98, 0x48, - 0x62, 0x03, 0x07, 0xad, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x82, 0x71, 0x79, 0x6a, 0x9c, 0x01, - 0x00, 0x00, + 0x2c, 0xce, 0xf8, 0x74, 0x4f, 0x5e, 0x11, 0xc4, 0xb1, 0x52, 0xd2, 0x55, 0x52, 0x28, 0x4b, 0xcc, + 0xc9, 0x4c, 0x49, 0x2c, 0x49, 0xb5, 0x52, 0x2a, 0x4a, 0x2d, 0x2c, 0xcd, 0x2c, 0x4a, 0x4d, 0xd1, + 0x01, 0xc9, 0x29, 0x05, 0x81, 0x6d, 0x11, 0xaa, 0xe7, 0xe2, 0x2e, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, + 0x4e, 0x05, 0xe9, 0x94, 0x60, 0x02, 0x5b, 0x1a, 0x4b, 0x9e, 0xa5, 0x6a, 0x10, 0x4b, 0xf3, 0x12, + 0x73, 0x53, 0xad, 0x8c, 0xf0, 0xd8, 0x8c, 0x6c, 0xa3, 0x50, 0x39, 0x17, 0x7b, 0x6a, 0x5e, 0x19, + 0xd8, 0x72, 0x66, 0x6a, 0x59, 0x6e, 0x8c, 0xc7, 0x72, 0x98, 0x6d, 0x4e, 0x26, 0x27, 0x1e, 0xca, + 0x31, 0xac, 0x78, 0x24, 0xc7, 0x18, 0xa5, 0x45, 0xd8, 0x26, 0x58, 0x04, 0x27, 0xb1, 0x81, 0x63, + 0xcc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x1b, 0xdc, 0x00, 0xf3, 0x01, 0x00, 0x00, } func (this *Instance) Equal(that interface{}) bool { diff --git a/ownership/ownership.pb.go b/ownership/ownership.pb.go index 295f8e8f8..203112c10 100644 --- a/ownership/ownership.pb.go +++ b/ownership/ownership.pb.go @@ -58,15 +58,16 @@ func (Ownership_Resource) EnumDescriptor() ([]byte, []int) { // Ownership is a ownership relation between one owner and a resource. type Ownership struct { // Service's hash. - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` // The owner of the resource. + // TODO: to transform to accAddress Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" hash:"name:2" validate:"required"` // Resource's hash. - ResourceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=resourceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"resourceHash" hash:"name:3"` + ResourceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=resourceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"resourceHash" hash:"name:3" validate:"required,hash"` // Resource's type. - Resource Ownership_Resource `protobuf:"varint,4,opt,name=resource,proto3,enum=mesg.types.Ownership_Resource" json:"resource,omitempty"` + Resource Ownership_Resource `protobuf:"varint,4,opt,name=resource,proto3,enum=mesg.types.Ownership_Resource" json:"resource,omitempty" validate:"required"` // The address of the resource. - ResourceAddress github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=resourceAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"resourceAddress,omitempty" hash:"-" validate:"accaddress"` + ResourceAddress github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=resourceAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"resourceAddress,omitempty" hash:"-" validate:"required,accaddress"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -104,32 +105,33 @@ func init() { func init() { proto.RegisterFile("ownership.proto", fileDescriptor_21ae26e0dccf9d04) } var fileDescriptor_21ae26e0dccf9d04 = []byte{ - // 390 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xcf, 0x8e, 0x93, 0x40, - 0x1c, 0x2e, 0x2d, 0xad, 0xed, 0x58, 0x2d, 0x99, 0x13, 0x31, 0x06, 0x70, 0x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xf9, 0xf6, 0x50, 0xda, 0x6f, 0x1a, 0x19, 0xa7, 0x19, 0x04, 0xb3, 0xcb, 0xda, 0x46, 0x83, - 0x13, 0x34, 0x96, 0xa0, 0x44, 0x21, 0x19, 0x54, 0x91, 0x66, 0xaf, 0x6e, 0xfb, 0xf1, 0x69, 0x6d, - 0x5f, 0x9c, 0xc5, 0xce, 0x49, 0x78, 0xcf, 0x19, 0x07, 0x68, 0xd8, 0x62, 0x53, 0x77, 0xb4, 0xe9, - 0xcb, 0x99, 0xe5, 0xdd, 0x0d, 0xec, 0x9d, 0x86, 0xf3, 0xc2, 0x23, 0x2b, 0x3c, 0xf1, 0xf1, 0x1f, - 0x34, 0x69, 0xcf, 0x8b, 0x28, 0x92, 0xa0, 0x94, 0xd9, 0x6f, 0x66, 0x3d, 0x94, 0xb6, 0x75, 0x61, - 0x23, 0xca, 0x18, 0x6d, 0x88, 0xe4, 0xa6, 0xb4, 0xdd, 0xb3, 0x6b, 0x30, 0xa1, 0x32, 0xa1, 0x8e, - 0x1f, 0x57, 0x45, 0xdf, 0xfd, 0x26, 0x7f, 0xc1, 0xd8, 0xd1, 0x3a, 0x7c, 0x98, 0x45, 0x02, 0x34, - 0x6c, 0x4b, 0xe1, 0x21, 0xd2, 0x3f, 0x0b, 0x0e, 0x46, 0x07, 0x3f, 0x47, 0xcf, 0x56, 0x20, 0x77, - 0x29, 0x03, 0x43, 0xab, 0xc0, 0x57, 0x29, 0x18, 0x28, 0x65, 0x74, 0x31, 0x42, 0x83, 0xb0, 0xe0, - 0x1c, 0xa4, 0xd1, 0x5b, 0xbe, 0xdf, 0x5f, 0x59, 0x9d, 0x7f, 0xd7, 0x96, 0xf6, 0xed, 0x11, 0x63, - 0x9e, 0x5e, 0xe0, 0x7a, 0x50, 0x3f, 0xa9, 0xf9, 0x6d, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x62, - 0x80, 0xe0, 0x95, 0x02, 0x00, 0x00, + // 407 bytes of a gzipped FileDescri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, 0xed, 0x03, 0x82, 0xf1, 0x71, 0x52, + 0x0b, 0x01, 0xca, 0x3e, 0x8c, 0x9f, 0x2d, 0x7e, 0x8e, 0x06, 0xdf, 0x7e, 0x8d, 0xd0, 0xdb, 0xff, + 0xb8, 0x88, 0xf5, 0x0e, 0x4f, 0x8e, 0xcd, 0x52, 0x5e, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc1, + 0xad, 0x64, 0x6e, 0xd7, 0x02, 0x00, 0x00, } func (this *Ownership) Equal(that interface{}) bool { diff --git a/process/process.pb.go b/process/process.pb.go index d519b2f18..e497c67c0 100644 --- a/process/process.pb.go +++ b/process/process.pb.go @@ -98,15 +98,15 @@ func (Process_Node_Filter_Condition_Predicate) EnumDescriptor() ([]byte, []int) // A process is a configuration to trigger a specific task when certains conditions of a trigger are valid. type Process struct { // Process's hash - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` // Process's name - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" hash:"name:2" validate:"required"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" hash:"name:2" validate:"required,printascii"` // Nodes with information related to the execution to trigger. Nodes []*Process_Node `protobuf:"bytes,4,rep,name=nodes,proto3" json:"nodes,omitempty" hash:"name:4" validate:"dive,required"` // Edges to create the link between the nodes. Edges []*Process_Edge `protobuf:"bytes,5,rep,name=edges,proto3" json:"edges,omitempty" hash:"name:5" validate:"dive,required"` // The address of the process. - Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,6,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-"` + Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,6,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-" validate:"required,accaddress"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -258,7 +258,7 @@ func (*Process_Node) XXX_OneofWrappers() []interface{} { type Process_Node_Result struct { // Hash of the instance that triggers the process. - InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required"` + InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required,hash"` // Key of the task that triggers the process. TaskKey string `protobuf:"bytes,3,opt,name=taskKey,proto3" json:"taskKey,omitempty" hash:"name:3" validate:"printascii,required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -292,7 +292,7 @@ var xxx_messageInfo_Process_Node_Result proto.InternalMessageInfo type Process_Node_Event struct { // Hash of the instance that triggers the process. - InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required"` + InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required,hash"` // Key of the event that triggers the process. EventKey string `protobuf:"bytes,3,opt,name=eventKey,proto3" json:"eventKey,omitempty" hash:"name:3" validate:"printascii,required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -326,7 +326,7 @@ var xxx_messageInfo_Process_Node_Event proto.InternalMessageInfo type Process_Node_Task struct { // Hash of the instance to execute. - InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required"` + InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:2" validate:"required,hash"` // Task of the instance to execute. TaskKey string `protobuf:"bytes,3,opt,name=taskKey,proto3" json:"taskKey,omitempty" hash:"name:3" validate:"printascii,required"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -839,83 +839,84 @@ func init() { func init() { proto.RegisterFile("process.proto", fileDescriptor_54c4d0e8c0aaf5c3) } var fileDescriptor_54c4d0e8c0aaf5c3 = []byte{ - // 1204 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0xf6, 0xda, 0x8e, 0x5f, 0xdc, 0xca, 0x8c, 0x10, 0x5a, 0x2d, 0x6d, 0x37, 0xb8, - 0x2a, 0x4d, 0x20, 0x59, 0x13, 0x27, 0x6d, 0x69, 0x10, 0x42, 0xd9, 0xc8, 0xfd, 0x41, 0x5d, 0x37, - 0x71, 0x9d, 0x02, 0xbd, 0x44, 0x9b, 0xdd, 0xb1, 0xbd, 0xca, 0x7a, 0xc7, 0xdd, 0x99, 0x0d, 0x09, - 0xe2, 0xc4, 0x81, 0xbf, 0x85, 0x7f, 0x83, 0x5b, 0x8f, 0x08, 0xc4, 0x05, 0x21, 0x4b, 0xf4, 0x8a, - 0xc4, 0xc1, 0x47, 0x2e, 0xa0, 0x99, 0x59, 0x3b, 0x4e, 0x6c, 0xa7, 0x4e, 0x29, 0x42, 0xe2, 0x94, - 0x78, 0xf7, 0xbd, 0xcf, 0xdb, 0xf9, 0xbe, 0x37, 0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0x30, 0xe3, 0x75, 0x98, - 0x55, 0xe2, 0x62, 0xeb, 0xbd, 0x5e, 0xd7, 0x78, 0x77, 0x88, 0xba, 0x36, 0x4c, 0x75, 0xbd, 0x03, - 0xbc, 0x74, 0x8c, 0x96, 0x48, 0xce, 0xc6, 0x6e, 0x13, 0x53, 0x2d, 0x35, 0x99, 0x5d, 0x76, 0x9b, - 0xa3, 0xec, 0x1b, 0x67, 0xb1, 0x05, 0x12, 0x7d, 0x06, 0x19, 0xdb, 0x75, 0x43, 0x4c, 0xa9, 0x96, - 0x16, 0xf2, 0x7e, 0xdc, 0xeb, 0x1a, 0xb3, 0x7d, 0xad, 0xfe, 0xec, 0x1a, 0xcb, 0x43, 0x32, 0x3b, - 0x84, 0xb6, 0x09, 0x8d, 0xff, 0x2c, 0x53, 0x77, 0x5f, 0x66, 0xce, 0xdc, 0x70, 0x9c, 0x0d, 0x09, - 0xa9, 0xf5, 0x69, 0xfa, 0xb7, 0x1a, 0xa8, 0x7c, 0xc1, 0xe8, 0x16, 0x24, 0xf7, 0xf1, 0x91, 0x48, - 0xde, 0xa8, 0xa6, 0x2b, 0xe3, 0x35, 0xe5, 0x1e, 0xa8, 0x02, 0xe9, 0x10, 0xd3, 0xc8, 0x67, 0x22, - 0x1f, 0x73, 0x25, 0x63, 0x92, 0xa6, 0x66, 0x4d, 0x98, 0x59, 0x6f, 0xf4, 0xba, 0xc6, 0x85, 0x13, - 0x09, 0xbb, 0x37, 0x53, 0x8b, 0x19, 0xe8, 0x3e, 0xa4, 0xf0, 0x01, 0x0e, 0x98, 0x96, 0x14, 0xb0, - 0x2b, 0x13, 0x61, 0x65, 0x6e, 0x35, 0xc2, 0x5a, 0xe5, 0x2c, 0x49, 0x40, 0x77, 0x40, 0x65, 0x36, - 0xdd, 0xd7, 0x54, 0x41, 0xba, 0x3c, 0x91, 0x54, 0xb7, 0xe9, 0xfe, 0x08, 0x68, 0x8d, 0x83, 0x84, - 0x3f, 0xda, 0x84, 0x64, 0xd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0x3a, - 0xdd, 0x0e, 0x00, 0x00, + // 1225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0x6f, 0x6f, 0xdb, 0x44, + 0x1c, 0xc7, 0xeb, 0xc4, 0x49, 0x9a, 0x5f, 0xb3, 0x29, 0x9c, 0x10, 0xb2, 0xcc, 0x36, 0x17, 0x4f, + 0x5b, 0x5b, 0x68, 0x1d, 0x9a, 0x74, 0x1b, 0x94, 0x07, 0xa8, 0x2e, 0xd9, 0x1f, 0x96, 0x65, 0x6d, + 0x48, 0x27, 0x98, 0x40, 0x95, 0x6b, 0x5f, 0x12, 0xab, 0x8e, 0x9d, 0xf9, 0xce, 0xa5, 0xe5, 0x19, + 0x7b, 0x15, 0xbc, 0x04, 0x5e, 0xca, 0xde, 0x00, 0x08, 0x10, 0x8a, 0xc4, 0x9e, 0x22, 0xf1, 0x20, + 0x0f, 0x79, 0x02, 0xba, 0x3b, 0x27, 0x4d, 0x9b, 0xa4, 0x4d, 0xc7, 0x90, 0x10, 0x8f, 0x12, 0xdb, + 0xf7, 0xfb, 0xfc, 0xee, 0xbe, 0xbf, 0x3f, 0x77, 0x07, 0x97, 0x3a, 0x61, 0x60, 0x63, 0x42, 0x8c, + 0x4e, 0x18, 0xd0, 0x00, 0x41, 0x1b, 0x93, 0xa6, 0x41, 0x8f, 0x3a, 0x98, 0xa8, 0x7a, 0x33, 0x68, + 0x06, 0x05, 0xfe, 0x7e, 0x2f, 0x6a, 0x14, 0xd8, 0x13, 0x7f, 0xe0, 0xff, 0xc4, 0x78, 0xf5, 0xed, + 0xc1, 0x67, 0x6e, 0x53, 0x20, 0x34, 0x8c, 0x6c, 0x2a, 0x3e, 0xea, 0xcf, 0xaf, 0x42, 0x66, 0x4b, + 0xe0, 0x91, 0x07, 0x72, 0xcb, 0x22, 0x2d, 0x45, 0x9a, 0x97, 0x16, 0x73, 0xe6, 0xe7, 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3, 0xb4, 0xb3, 0x6c, 0x3b, 0xb6, 0xd0, 0xff, 0xec, 0x6a, 0x2b, 0x43, 0x51, + 0xb1, 0x03, 0xd2, 0x0e, 0x48, 0xfc, 0xb3, 0x42, 0x9c, 0x7d, 0x11, 0x68, 0x63, 0xc3, 0xb6, 0x37, + 0x84, 0x45, 0xad, 0xef, 0x4c, 0xfd, 0x4e, 0x01, 0x99, 0xe9, 0x81, 0xee, 0x40, 0x72, 0x1f, 0x1f, + 0xf1, 0x58, 0x67, 0xcd, 0x1b, 0xc7, 0x81, 0xe3, 0x0b, 0x58, 0x1d, 0x37, 0x03, 0xbd, 0xc6, 0x2c, + 0x50, 0x05, 0xd2, 0x21, 0x26, 0x91, 0x47, 0x79, 0xe4, 0xe6, 0x8a, 0xda, 0x24, 0xc9, 0x8d, 0x1a, + 0x1f, 0x66, 0xbe, 0xd1, 0xeb, 0x6a, 0x97, 0x4e, 0x84, 0xf6, 0xfe, 0x4c, 0x2d, 0x66, 0xa0, 0x07, + 0x90, 0xc2, 0x07, 0xd8, 0xa7, 0x4a, 0x92, 0xc3, 0xae, 0x4d, 0x84, 0x95, 0xd9, 0xa8, 0x11, 0x56, + 0x89, 0xb1, 0x04, 0x01, 0xdd, 0x05, 0x99, 0x5a, 0x64, 0x5f, 0x91, 0x39, 0xe9, 0xea, 0x44, 0x52, + 0xdd, 0x22, 0xfb, 0x23, 0xa0, 0x35, 0x06, 0xe2, 0xf6, 0x68, 0x13, 0x92, 0x6d, 0xab, 0xa3, 0xa4, + 0x38, 0xe6, 0xca, 0x44, 0xcc, 0x23, 0xab, 0x33, 0x42, 0xb9, 0xc5, 0x28, 0xcc, 0x9a, 0xa9, 0xd4, + 0x70, 0x3d, 0x8a, 0x43, 0x1e, 0xde, 0xb3, 0x54, 0xba, 0xcb, 0x87, 0x8d, 0xa0, 0x6e, 0x73, 0x95, + 0x04, 0x43, 0xfd, 0x49, 0x82, 0xb4, 0x50, 0x13, 0x7d, 0x2b, 0x41, 0xce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48, 0xf5, 0x07, 0x09, 0x64, 0x36, + 0x02, 0x7d, 0x34, 0x7c, 0x94, 0x59, 0xe8, 0x75, 0xb5, 0xeb, 0x93, 0x26, 0x38, 0x74, 0x7e, 0x64, + 0x79, 0xc4, 0xe4, 0x5a, 0x82, 0x94, 0xeb, 0x3b, 0xf8, 0x90, 0xcf, 0x50, 0x1e, 0x5f, 0xec, 0x62, + 0xc4, 0x60, 0x2d, 0xc9, 0xd7, 0xb6, 0x96, 0x52, 0xbc, 0x16, 0x13, 0x60, 0x96, 0x60, 0x0f, 0xdb, + 0x34, 0x08, 0xf5, 0xb7, 0x40, 0x66, 0x8d, 0x0a, 0x5d, 0x06, 0xa8, 0xee, 0x54, 0x2a, 0xbb, 0x4f, + 0x36, 0x2a, 0x3b, 0xe5, 0xfc, 0x8c, 0x99, 0x89, 0x03, 0xfb, 0xef, 0xe7, 0xc0, 0xef, 0x49, 0x48, + 0x8b, 0x63, 0x09, 0xea, 0x00, 0xd8, 0x81, 0xef, 0xb8, 0x6c, 0x2f, 0x22, 0x4a, 0xe2, 0x9c, 0x26, + 0x2f, 0x8c, 0x8c, 0xcd, 0xbe, 0x85, 0x79, 0x83, 0xed, 0x70, 0xbd, 0xae, 0x76, 0x75, 0xd2, 0x96, + 0xc5, 0xf2, 0x5c, 0xaf, 0x0d, 0xf9, 0x50, 0xff, 0x48, 0x40, 0x76, 0x00, 0x40, 0xe6, 0x70, 0x6c, + 0x4f, 0xef, 0x58, 0xab, 0xe7, 0x5e, 0x12, 0xb8, 0x1a, 0x87, 0x90, 0xed, 0x84, 0xd8, 0x71, 0x6d, + 0x8b, 0x0a, 0x45, 0x2e, 0x17, 0x4b, 0x53, 0x2f, 0xc1, 0xd8, 0xea, 0x9b, 0x8e, 0xe4, 0x7e, 0x71, + 0x7c, 0xee, 0x1f, 0x3b, 0x43, 0xdb, 0xfd, 0x38, 0x88, 0x33, 0xe9, 0x9b, 0xc2, 0x6b, 0xff, 0x3e, + 0x66, 0x3c, 0x61, 0xdf, 0x46, 0xb0, 0x6b, 0xe3, 0xb1, 0x82, 0xa4, 0x6f, 0x41, 0x76, 0x30, 0x23, + 0x34, 0x07, 0x99, 0x1d, 0x7f, 0xdf, 0x0f, 0xbe, 0xf6, 0xf3, 0x33, 0x28, 0x0d, 0x89, 0xf2, 0x76, + 0x5e, 0x62, 0xbf, 0xf7, 0xea, 0xf9, 0x04, 0xca, 0x40, 0xf2, 0x5e, 0xbd, 0x9c, 0x4f, 0xb2, 0x17, + 0x95, 0x7a, 0x5e, 0x66, 0x2f, 0x2a, 0xf5, 0x72, 0x3e, 0x85, 0x72, 0x30, 0xbb, 0xf9, 0xb8, 0x5a, + 0xdf, 0x78, 0x50, 0xfd, 0x2c, 0x9f, 0x36, 0xd3, 0x20, 0x33, 0x1d, 0xd4, 0x43, 0x90, 0xd9, 0x6d, + 0x86, 0xdd, 0x0c, 0x48, 0x68, 0x5f, 0xf0, 0x66, 0x40, 0x42, 0x9b, 0x19, 0x3a, 0x83, 0x5d, 0x73, + 0x4a, 0xb1, 0x98, 0x85, 0x59, 0x7a, 0xf1, 0xdb, 0xb5, 0x99, 0xef, 0x5f, 0x5e, 0x93, 0x9e, 0x2e, + 0x9d, 0x7f, 0x12, 0x8a, 0x2f, 0xc3, 0x7b, 0x69, 0x2e, 0x63, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xf2, 0x17, 0x81, 0xfe, 0x1e, 0x0f, 0x00, 0x00, } func (this *Process) Equal(that interface{}) bool { diff --git a/protobuf/types/event.proto b/protobuf/types/event.proto index 27adb1595..f085fa38c 100644 --- a/protobuf/types/event.proto +++ b/protobuf/types/event.proto @@ -12,7 +12,7 @@ option (gogoproto.goproto_getters_all) = false; message Event { // Hash is a unique hash to identify event. bytes hash = 1 [ - (gogoproto.moretags) = 'hash:"-"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index 244e91db5..c438c26a3 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -34,7 +34,7 @@ enum Status { message Execution { // Hash is a unique hash to identify execution. bytes hash = 1 [ - (gogoproto.moretags) = 'hash:"-"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -43,33 +43,33 @@ message Execution { // if execution is triggered by another one, // dependency execution considered as the parent. bytes parentHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2"', + (gogoproto.moretags) = 'hash:"name:2" validate:"omitempty,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // eventHash is unique event hash. bytes eventHash = 3 [ - (gogoproto.moretags) = 'hash:"name:3"', + (gogoproto.moretags) = 'hash:"name:3" validate:"omitempty,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // Status is the current status of execution. Status status = 4 [ - (gogoproto.moretags) = 'hash:"-"' + (gogoproto.moretags) = 'hash:"-" validate:"required"' ]; // instanceHash is hash of the instance that can proceed an execution bytes instanceHash = 5 [ - (gogoproto.moretags) = 'hash:"name:5"', + (gogoproto.moretags) = 'hash:"name:5" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // taskKey is the key of the task of this execution. string taskKey = 6 [ - (gogoproto.moretags) = 'hash:"name:6"' + (gogoproto.moretags) = 'hash:"name:6" validate:"required,printascii"' ]; // inputs data of the execution. @@ -94,7 +94,7 @@ message Execution { // processHash is the unique hash of the process associated to this execution. bytes processHash = 11 [ - (gogoproto.moretags) = 'hash:"name:11"', + (gogoproto.moretags) = 'hash:"name:11" validate:"omitempty,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -106,7 +106,7 @@ message Execution { // runner that should execute this execution. bytes executorHash = 13 [ - (gogoproto.moretags) = 'hash:"name:13"', + (gogoproto.moretags) = 'hash:"name:13" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -125,14 +125,14 @@ message Execution { message Emitter { // Emitter's hash. bytes runnerHash = 1 [ - (gogoproto.moretags) = 'hash:"-" validate:"hash"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // Block height when this emitter proposed the execution. int64 blockHeight = 2 [ - (gogoproto.moretags) = 'hash:"-"' + (gogoproto.moretags) = 'hash:"-" validate:"required"' ]; } @@ -143,7 +143,7 @@ message Execution { // The address of the execution. bytes address = 17 [ - (gogoproto.moretags) = 'hash:"-" validate:"accaddress"', + (gogoproto.moretags) = 'hash:"-" validate:"required,accaddress"', (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; } diff --git a/protobuf/types/instance.proto b/protobuf/types/instance.proto index 433fe7e90..e4ebaaf80 100644 --- a/protobuf/types/instance.proto +++ b/protobuf/types/instance.proto @@ -11,18 +11,19 @@ option (gogoproto.equal_all) = true; // Instance represents service's instance. message Instance { bytes hash = 1 [ + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; bytes serviceHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2"', + (gogoproto.moretags) = 'hash:"name:2" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; bytes envHash = 3 [ - (gogoproto.moretags) = 'hash:"name:3"', + (gogoproto.moretags) = 'hash:"name:3" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; diff --git a/protobuf/types/ownership.proto b/protobuf/types/ownership.proto index f9039c50a..da61def0c 100644 --- a/protobuf/types/ownership.proto +++ b/protobuf/types/ownership.proto @@ -14,19 +14,20 @@ message Ownership { // Service's hash. bytes hash = 1 [ - (gogoproto.moretags) = 'hash:"-" validate:"required"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // The owner of the resource. + // TODO: to transform to accAddress string owner = 2 [ (gogoproto.moretags) = 'hash:"name:2" validate:"required"' ]; // Resource's hash. bytes resourceHash = 3 [ - (gogoproto.moretags) = 'hash:"name:3"', + (gogoproto.moretags) = 'hash:"name:3" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -39,11 +40,13 @@ message Ownership { } // Resource's type. - Resource resource = 4; + Resource resource = 4 [ + (gogoproto.moretags) = 'validate:"required"' + ]; // The address of the resource. bytes resourceAddress = 5 [ - (gogoproto.moretags) = 'hash:"-" validate:"accaddress"', + (gogoproto.moretags) = 'hash:"-" validate:"required,accaddress"', (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; } diff --git a/protobuf/types/process.proto b/protobuf/types/process.proto index 38644d19a..b864e23d7 100644 --- a/protobuf/types/process.proto +++ b/protobuf/types/process.proto @@ -16,7 +16,7 @@ message Process { message Result { // Hash of the instance that triggers the process. bytes instanceHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"required"', + (gogoproto.moretags) = 'hash:"name:2" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -30,7 +30,7 @@ message Process { message Event { // Hash of the instance that triggers the process. bytes instanceHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"required"', + (gogoproto.moretags) = 'hash:"name:2" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -44,7 +44,7 @@ message Process { message Task { // Hash of the instance to execute. bytes instanceHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"required"', + (gogoproto.moretags) = 'hash:"name:2" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; @@ -233,14 +233,14 @@ message Process { // Process's hash bytes hash = 1 [ - (gogoproto.moretags) = 'hash:"-" validate:"required"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // Process's name string name = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"required"' + (gogoproto.moretags) = 'hash:"name:2" validate:"required,printascii"' ]; // Nodes with information related to the execution to trigger. @@ -255,7 +255,7 @@ message Process { // The address of the process. bytes address = 6 [ - (gogoproto.moretags) = 'hash:"-"', + (gogoproto.moretags) = 'hash:"-" validate:"required,accaddress"', (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; } diff --git a/protobuf/types/runner.proto b/protobuf/types/runner.proto index 4e83bf559..2d0d01529 100644 --- a/protobuf/types/runner.proto +++ b/protobuf/types/runner.proto @@ -12,26 +12,26 @@ option (gogoproto.equal_all) = true; message Runner { // Runner's hash bytes hash = 1 [ - (gogoproto.moretags) = 'hash:"-"', + (gogoproto.moretags) = 'hash:"-" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // owner of the engine of this runner string owner = 2 [ - (gogoproto.moretags) = 'hash:"name:2"' + (gogoproto.moretags) = 'hash:"name:2" validate:"required"' ]; // instanceHash is hash of the instance that runner will handle bytes instanceHash = 3 [ - (gogoproto.moretags) = 'hash:"name:3"', + (gogoproto.moretags) = 'hash:"name:3" validate:"required,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // The address of the runner. bytes address = 4 [ - (gogoproto.moretags) = 'hash:"-" validate:"accaddress"', + (gogoproto.moretags) = 'hash:"-" validate:"required,accaddress"', (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; } diff --git a/runner/runner.pb.go b/runner/runner.pb.go index 09517fc9d..ff344541b 100644 --- a/runner/runner.pb.go +++ b/runner/runner.pb.go @@ -27,13 +27,13 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Runner represents one node service's instance. type Runner struct { // Runner's hash - Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-"` + Hash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"hash" hash:"-" validate:"required,hash"` // owner of the engine of this runner - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" hash:"name:2"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" hash:"name:2" validate:"required"` // instanceHash is hash of the instance that runner will handle - InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:3"` + InstanceHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=instanceHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"instanceHash" hash:"name:3" validate:"required,hash"` // The address of the runner. - Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-" validate:"accaddress"` + Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" hash:"-" validate:"required,accaddress"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -70,27 +70,28 @@ func init() { func init() { proto.RegisterFile("runner.proto", fileDescriptor_48eceea7e2abc593) } var fileDescriptor_48eceea7e2abc593 = []byte{ - // 307 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0x9b, 0xfe, 0xfd, 0x0b, 0x58, 0x61, 0x20, 0x53, 0xc4, 0x10, 0x47, 0x5e, 0x88, 0x84, - 0x12, 0x4b, 0xed, 0x96, 0x05, 0x35, 0x62, 0x60, 0x4e, 0x37, 0x36, 0xc7, 0x71, 0x93, 0x08, 0x62, - 0x57, 0xb1, 0x03, 0xe2, 0x8d, 0x78, 0x94, 0x3e, 0x03, 0x83, 0x11, 0x3c, 0x42, 0x46, 0x26, 0x14, - 0xbb, 0x95, 0xca, 0x84, 0xc4, 0x64, 0x5f, 0xfb, 0xdc, 0xef, 0x1c, 0xfb, 0x02, 0xb7, 0xeb, 0x39, - 0x67, 0x5d, 0xb2, 0xed, 0x84, 0x12, 0x1e, 0x68, 0x99, 0xac, 0x12, 0xf5, 0xb2, 0x65, 0xf2, 0x12, - 0x55, 0xa2, 0x12, 0xd8, 0x9c, 0x17, 0xfd, 0x06, 0x8f, 0x95, 0x29, 0xcc, 0xce, 0xea, 0xd1, 0xfb, - 0x14, 0xcc, 0x73, 0x03, 0xf0, 0xd6, 0x60, 0x56, 0x13, 0x59, 0xfb, 0x4e, 0xe8, 0x44, 0x6e, 0x76, - 0xb3, 0xd3, 0x70, 0xf2, 0xa6, 0xe1, 0x75, 0xd5, 0xa8, 0xba, 0x2f, 0x12, 0x2a, 0x5a, 0x3c, 0xb2, - 0xe3, 0x8d, 0xe8, 0x79, 0x49, 0x54, 0x23, 0x38, 0x66, 0xbc, 0x6a, 0x38, 0xc3, 0x63, 0x57, 0x72, - 0x47, 0x64, 0x3d, 0x68, 0x78, 0x3a, 0x16, 0x29, 0x8a, 0x51, 0x6e, 0x60, 0xde, 0x15, 0xf8, 0x2f, - 0x9e, 0x39, 0xeb, 0xfc, 0x69, 0xe8, 0x44, 0x67, 0xd9, 0xc5, 0xa0, 0xe1, 0xb9, 0x95, 0x70, 0xd2, - 0xb2, 0x74, 0x81, 0x72, 0x7b, 0xef, 0xd5, 0xc0, 0x6d, 0xb8, 0x54, 0x84, 0x53, 0x36, 0xa2, 0xfc, - 0x7f, 0x26, 0xc5, 0xed, 0xdf, 0x52, 0x1c, 0x5b, 0x2c, 0x51, 0xfe, 0x83, 0xec, 0xb5, 0xe0, 0x84, - 0x94, 0x65, 0xc7, 0xa4, 0xf4, 0x67, 0xc6, 0x64, 0x3d, 0x68, 0x18, 0x1c, 0x72, 0x87, 0x4f, 0xe4, - 0xb1, 0x29, 0x89, 0x62, 0x29, 0x22, 0x94, 0xee, 0x85, 0xe8, 0x4b, 0xc3, 0xf8, 0x28, 0x02, 0x15, - 0xb2, 0x15, 0x72, 0xbf, 0xc4, 0xb2, 0x7c, 0xc0, 0xe6, 0xc7, 0x93, 0x15, 0xa5, 0x2b, 0xdb, 0x91, - 0x1f, 0x3c, 0xb2, 0xc5, 0xee, 0x23, 0x98, 0xbc, 0x7e, 0x06, 0xce, 0x7d, 0xf4, 0xfb, 0x23, 0xec, - 0x2c, 0x8b, 0xb9, 0x19, 0xce, 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x91, 0x27, 0xd4, 0xaf, 0xdc, - 0x01, 0x00, 0x00, + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0x9b, 0xbf, 0xfd, 0x8b, 0xb0, 0x3a, 0x65, 0x8a, 0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 0x0a, 0x18, 0x0d, 0x7e, 0x32, 0xc0, 0x69, 0xad, 0xf1, 0x1f, 0x3d, 0xd4, 0xe1, 0x42, + 0x1b, 0x22, 0x28, 0x58, 0x70, 0xd0, 0x74, 0x99, 0x6f, 0xfe, 0x96, 0xf9, 0x78, 0x8b, 0x3b, 0xdc, + 0x11, 0xfc, 0x1b, 0xd2, 0x5f, 0xa2, 0x3d, 0xc2, 0x98, 0x02, 0xad, 0x83, 0x96, 0xa3, 0x5f, 0xaf, + 0xab, 0xf0, 0x64, 0x57, 0xfb, 0x84, 0xd2, 0x8d, 0x02, 0xbf, 0x57, 0x61, 0xb4, 0x15, 0x92, 0x4a, + 0x5d, 0x48, 0xbd, 0x59, 0x22, 0xcd, 0x6e, 0x13, 0x37, 0xc1, 0x78, 0x4c, 0xe9, 0xb8, 0x56, 0xa4, + 0x9f, 0xb0, 0xc9, 0x60, 0xf5, 0xda, 0x6d, 0x3c, 0xbd, 0x75, 0xbd, 0xab, 0xfe, 0xef, 0x6d, 0xd6, + 0x7f, 0x63, 0xda, 0x76, 0xc3, 0x1e, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0x81, 0xe2, 0x9d, 0x6e, + 0x2c, 0x02, 0x00, 0x00, } func (this *Runner) Equal(that interface{}) bool { From 8b7060eb17f1198e1a5c396debad5973500b3b5d Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Wed, 25 Mar 2020 14:51:39 +0700 Subject: [PATCH 4/6] fix process validation test --- process/process_test.go | 63 +++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/process/process_test.go b/process/process_test.go index 468c83990..6c79d0840 100644 --- a/process/process_test.go +++ b/process/process_test.go @@ -3,9 +3,11 @@ package process import ( "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/protobuf/types" "github.com/stretchr/testify/assert" + "github.com/tendermint/tendermint/crypto" ) func TestValidateProcess(t *testing.T) { @@ -47,10 +49,12 @@ func TestValidateProcess(t *testing.T) { err string }{ {w: &Process{ - Hash: hash.Int(1), - Name: "invalid-struct", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "invalid-struct", }, err: "should contain exactly one trigger"}, {w: &Process{ + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), Nodes: []*Process_Node{ { Type: &Process_Node_Result_{&Process_Node_Result{InstanceHash: hash.Int(1)}}, @@ -60,29 +64,33 @@ func TestValidateProcess(t *testing.T) { Name: "missing-key", }, err: "Key is a required field. TaskKey is a required field"}, {w: &Process{ - Hash: hash.Int(1), - Name: "edge-src-missing-node", - Nodes: nodes, - Edges: append(edges, &Process_Edge{Src: "-", Dst: "nodeKey2"}), + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "edge-src-missing-node", + Nodes: nodes, + Edges: append(edges, &Process_Edge{Src: "-", Dst: "nodeKey2"}), }, err: "node \"-\" not found"}, {w: &Process{ - Hash: hash.Int(1), - Name: "edge-dst-missing-node", - Nodes: nodes, - Edges: append(edges, &Process_Edge{Src: "nodeKey1", Dst: "-"}), + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "edge-dst-missing-node", + Nodes: nodes, + Edges: append(edges, &Process_Edge{Src: "nodeKey1", Dst: "-"}), }, err: "node \"-\" not found"}, {w: &Process{ - Hash: hash.Int(1), - Name: "cyclic-graph", - Nodes: nodes, + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "cyclic-graph", + Nodes: nodes, Edges: append(edges, &Process_Edge{Src: "nodeKey1", Dst: "nodeKey2"}, &Process_Edge{Src: "nodeKey2", Dst: "nodeKey1"}, ), }, err: "process should not contain any cycles"}, {w: &Process{ - Hash: hash.Int(1), - Name: "non-connected-graph", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "non-connected-graph", Nodes: append(nodes, &Process_Node{ Key: "nodeKey3", Type: &Process_Node_Task_{&Process_Node_Task{ @@ -102,8 +110,9 @@ func TestValidateProcess(t *testing.T) { ), }, err: "process should be a connected graph"}, {w: &Process{ - Hash: hash.Int(1), - Name: "multiple-parent-graph", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "multiple-parent-graph", Nodes: append(nodes, &Process_Node{ Key: "nodeKey3", Type: &Process_Node_Task_{&Process_Node_Task{ @@ -125,8 +134,9 @@ func TestValidateProcess(t *testing.T) { ), }, err: "process should contain nodes with one parent maximum"}, {w: &Process{ - Hash: hash.Int(1), - Name: "multiple-parent-graph", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "multiple-parent-graph", Nodes: append(nodes, &Process_Node{ Key: "nodeKey3", Type: &Process_Node_Task_{&Process_Node_Task{ @@ -168,8 +178,9 @@ func TestValidateProcess(t *testing.T) { ), }, valid: true}, {w: &Process{ - Hash: hash.Int(1), - Name: "inputs-with-invalid-node", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "inputs-with-invalid-node", Nodes: append(nodes, &Process_Node{ Key: "mapping", Type: &Process_Node_Map_{&Process_Node_Map{ @@ -184,8 +195,9 @@ func TestValidateProcess(t *testing.T) { }), }, err: "node \"invalid\" not found"}, {w: &Process{ - Hash: hash.Int(1), - Name: "inputs-with-valid-ref", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "inputs-with-valid-ref", Nodes: append(nodes, &Process_Node{ Key: "mapping", Type: &Process_Node_Map_{&Process_Node_Map{ @@ -204,8 +216,9 @@ func TestValidateProcess(t *testing.T) { ), }, valid: true}, {w: &Process{ - Hash: hash.Int(1), - Name: "filter-gte-invalid-value-type", + Address: sdk.AccAddress(crypto.AddressHash([]byte("address"))), + Hash: hash.Int(1), + Name: "filter-gte-invalid-value-type", Nodes: append(nodes, &Process_Node{ Key: "filter", Type: &Process_Node_Filter_{&Process_Node_Filter{ From 7c72a1be174f70f77d013a7315160c35b3ff39aa Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Wed, 25 Mar 2020 15:08:18 +0700 Subject: [PATCH 5/6] improve validation on execution's price --- execution/execution.pb.go | 103 +++++++++++++++++---------------- protobuf/types/execution.proto | 2 +- 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/execution/execution.pb.go b/execution/execution.pb.go index 62fe59473..57029d1ef 100644 --- a/execution/execution.pb.go +++ b/execution/execution.pb.go @@ -99,7 +99,7 @@ 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" validate:"required,hash"` // 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:"required,coinsPositiveZero"` // blockHeight where the execution was included into blockchain. BlockHeight int64 `protobuf:"varint,15,opt,name=blockHeight,proto3" json:"blockHeight,omitempty" hash:"-"` // list of emitters of this execution. @@ -179,57 +179,58 @@ func init() { func init() { proto.RegisterFile("execution.proto", fileDescriptor_776e2c5022e94aef) } var fileDescriptor_776e2c5022e94aef = []byte{ - // 792 bytes of a gzipped FileDescriptorProto + // 802 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0xc7, 0xeb, 0xa6, 0x4d, 0x9a, 0x93, 0x34, 0x9b, 0x1d, 0x09, 0xc9, 0x2a, 0xcb, 0xda, 0x18, - 0x09, 0x0c, 0x34, 0xce, 0x36, 0x65, 0x41, 0x54, 0x42, 0xa2,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 0xea, 0xc3, 0xde, 0x39, 0x67, 0x19, 0x13, 0x38, 0x1e, 0x18, 0xe8, 0x00, 0xe0, + 0x13, 0x7a, 0xce, 0x59, 0x52, 0x25, 0x3f, 0xd8, 0x46, 0xfb, 0xd0, 0xfd, 0x88, 0xa5, 0xd9, 0x0c, + 0x4b, 0x1c, 0x0f, 0x5a, 0x08, 0xa0, 0xfd, 0x71, 0x48, 0x66, 0x38, 0x1e, 0xec, 0xf8, 0x0f, 0x5e, + 0xfc, 0x79, 0x77, 0xeb, 0xd7, 0xbf, 0xee, 0x1a, 0x4f, 0xff, 0x47, 0xee, 0xcb, 0xb7, 0xfa, 0xa2, + 0xad, 0xfa, 0xcc, 0xc9, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x0f, 0x29, 0x1f, 0xbf, 0x07, + 0x00, 0x00, } func (this *Execution) Equal(that interface{}) bool { diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index c438c26a3..4cf5fe92a 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -113,7 +113,7 @@ message Execution { // price of running the exeuction. string price = 14 [ - (gogoproto.moretags) = 'hash:"name:14" validate:"coins"' + (gogoproto.moretags) = 'hash:"name:14" validate:"required,coinsPositiveZero"' ]; // blockHeight where the execution was included into blockchain. From b1541fc590f28af385da0fca04322d1318e3a8d7 Mon Sep 17 00:00:00 2001 From: Nicolas Mahe Date: Thu, 26 Mar 2020 14:04:55 +0700 Subject: [PATCH 6/6] add required_without validation to parentHash and eventHash of execution --- execution/execution.pb.go | 110 +++++++++++++++++---------------- protobuf/types/execution.proto | 4 +- 2 files changed, 58 insertions(+), 56 deletions(-) diff --git a/execution/execution.pb.go b/execution/execution.pb.go index 57029d1ef..c1840d527 100644 --- a/execution/execution.pb.go +++ b/execution/execution.pb.go @@ -75,9 +75,9 @@ type Execution struct { // parentHash is the unique hash of parent execution. // if execution is triggered by another one, // dependency execution considered as the parent. - ParentHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=parentHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"parentHash" hash:"name:2" validate:"omitempty,hash"` + ParentHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,2,opt,name=parentHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"parentHash" hash:"name:2" validate:"required_without=EventHash,omitempty,hash"` // eventHash is unique event hash. - EventHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=eventHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"eventHash" hash:"name:3" validate:"omitempty,hash"` + EventHash github_com_mesg_foundation_engine_hash.Hash `protobuf:"bytes,3,opt,name=eventHash,proto3,customtype=github.com/mesg-foundation/engine/hash.Hash" json:"eventHash" hash:"name:3" validate:"required_without=ParentHash,omitempty,hash"` // Status is the current status of execution. Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=mesg.types.Status" json:"status,omitempty" hash:"-" validate:"required"` // instanceHash is hash of the instance that can proceed an execution @@ -179,58 +179,60 @@ func init() { func init() { proto.RegisterFile("execution.proto", fileDescriptor_776e2c5022e94aef) } var fileDescriptor_776e2c5022e94aef = []byte{ - // 802 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0xc7, 0xeb, 0xa6, 0x4d, 0x9a, 0x93, 0xb4, 0x9b, 0x1d, 0x09, 0xc9, 0x2a, 0xcb, 0xda, 0xf8, - 0x02, 0x0c, 0x34, 0xce, 0x36, 0xdd, 0x05, 0x54, 0x09, 0x89, 0x1a, 0x2d, 0x5a, 0x3e, 0xb4, 0xaa, - 0xbc, 0x42, 0xa0, 0x15, 0x1f, 0x72, 0xed, 0x59, 0x67, 0x94, 0x78, 0xc6, 0xcc, 0x8c, 0xc3, 0x56, - 0x42, 0x48, 0xf0,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 0xff, 0x0a, 0x0f, 0x29, 0x1f, 0xbf, 0x07, - 0x00, 0x00, + // 835 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xdd, 0x8e, 0xdb, 0x44, + 0x14, 0x5e, 0x6f, 0x76, 0x93, 0xcd, 0x49, 0x36, 0x4d, 0x47, 0x42, 0xb2, 0x96, 0x52, 0x1b, 0x5f, + 0x40, 0x80, 0x8d, 0xd3, 0x66, 0x5b, 0x40, 0x2b, 0x55, 0x62, 0x5d, 0x2d, 0x2a, 0x3f, 0xaa, 0x56, + 0xae, 0x10, 0xa8, 0x02, 0x2a, 0xaf, 0x3d, 0x75, 0x46, 0x1b, 0xcf, 0x98, 0x99, 0x71, 0xda, 0xe5, + 0x0e, 0xae, 0x78, 0x04, 0x78, 0x03, 0xde, 0x84, 0x3e, 0x03, 0x17, 0x96, 0xe0, 0x11, 0x7c, 0xc9, + 0x15, 0xf2, 0x38, 0xce, 0x4e, 0x96, 0x28, 0xa0, 0x48, 0x5c, 0x25, 0xe3, 0x39, 0xe7, 0xfb, 0xbe, + 0x33, 0xdf, 0x99, 0x33, 0x70, 0x03, 0xbf, 0xc4, 0x61, 0x26, 0x09, 0xa3, 0x6e, 0xca, 0x99, 0x64, + 0x08, 0x12, 0x2c, 0x62, 0x57, 0x5e, 0xa6, 0x58, 0x1c, 0x38, 0x31, 0x8b, 0xd9, 0x48, 0x7d, 0x3f, + 0xcf, 0x9e, 0x8f, 0xca, 0x95, 0x5a, 0xa8, 0x7f, 0x55, 0xfc, 0xc1, 0xeb, 0x8b, 0x6d, 0x95, 0x33, + 0x12, 0x92, 0x67, 0xa1, 0xac, 0x36, 0x9d, 0x9f, 0x7a, 0xd0, 0x3e, 0xad, 0x09, 0xd0, 0x14, 0x76, + 0x26, 0x81, 0x98, 0x98, 0x86, 0x6d, 0x0c, 0xba, 0xde, 0x57, 0xaf, 0x72, 0x6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e2, 0xca, 0xde, 0xff, 0xfb, 0x11, 0xd1, 0xb8, 0x90, 0xb7, 0x6c, 0xc3, 0xb6, 0xb2, 0xe1, 0xdf, + 0x87, 0xa0, 0x9e, 0xf4, 0xee, 0x63, 0x68, 0x56, 0xd3, 0x13, 0x75, 0xa0, 0xf5, 0x05, 0xbd, 0xa0, + 0xec, 0x05, 0xed, 0x6f, 0xa1, 0x2e, 0xec, 0x9d, 0x71, 0x96, 0x32, 0x81, 0xa3, 0xbe, 0x81, 0x7a, + 0x00, 0x9f, 0xd0, 0x33, 0xce, 0xe2, 0xb2, 0xf8, 0xfe, 0x36, 0xda, 0x87, 0xf6, 0x43, 0x96, 0xa4, + 0x53, 0x2c, 0x71, 0xd4, 0x6f, 0x20, 0x80, 0xe6, 0xc7, 0x01, 0x99, 0xe2, 0xa8, 0xbf, 0xe3, 0xdd, + 0x7f, 0xf5, 0xc7, 0xed, 0xad, 0x5f, 0xff, 0xbc, 0x6d, 0x3c, 0xfd, 0x0f, 0xb5, 0x2f, 0x1e, 0xf9, + 0xf3, 0xa6, 0x9a, 0x33, 0x47, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x19, 0xe0, 0xba, 0x5c, 0xf8, + 0x07, 0x00, 0x00, } func (this *Execution) Equal(that interface{}) bool { diff --git a/protobuf/types/execution.proto b/protobuf/types/execution.proto index 4cf5fe92a..46473fcfb 100644 --- a/protobuf/types/execution.proto +++ b/protobuf/types/execution.proto @@ -43,14 +43,14 @@ message Execution { // if execution is triggered by another one, // dependency execution considered as the parent. bytes parentHash = 2 [ - (gogoproto.moretags) = 'hash:"name:2" validate:"omitempty,hash"', + (gogoproto.moretags) = 'hash:"name:2" validate:"required_without=EventHash,omitempty,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ]; // eventHash is unique event hash. bytes eventHash = 3 [ - (gogoproto.moretags) = 'hash:"name:3" validate:"omitempty,hash"', + (gogoproto.moretags) = 'hash:"name:3" validate:"required_without=ParentHash,omitempty,hash"', (gogoproto.customtype) = "github.com/mesg-foundation/engine/hash.Hash", (gogoproto.nullable) = false ];