From c889ca67cb147321de0b4711124a6ba43fad804c Mon Sep 17 00:00:00 2001 From: antho1404 Date: Thu, 12 Mar 2020 21:22:09 +0700 Subject: [PATCH] add address to process --- e2e/process_test.go | 12 ++- process/process.pb.go | 140 +++++++++++++++------------- protobuf/types/process.proto | 4 + x/process/internal/keeper/keeper.go | 2 + 4 files changed, 87 insertions(+), 71 deletions(-) diff --git a/e2e/process_test.go b/e2e/process_test.go index 0b1d89aff..f3fcc5e37 100644 --- a/e2e/process_test.go +++ b/e2e/process_test.go @@ -4,11 +4,13 @@ import ( "context" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mesg-foundation/engine/hash" "github.com/mesg-foundation/engine/ownership" "github.com/mesg-foundation/engine/process" pb "github.com/mesg-foundation/engine/protobuf/api" "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto" ) var testProcessHash hash.Hash @@ -58,10 +60,11 @@ func testProcess(t *testing.T) { p, err := client.ProcessClient.Get(context.Background(), &pb.GetProcessRequest{Hash: testProcessHash}) require.NoError(t, err) require.True(t, p.Equal(&process.Process{ - Hash: p.Hash, - Name: req.Name, - Nodes: req.Nodes, - Edges: req.Edges, + Hash: p.Hash, + Address: sdk.AccAddress(crypto.AddressHash(p.Hash)).String(), + Name: req.Name, + Nodes: req.Nodes, + Edges: req.Edges, })) processHash = p.Hash }) @@ -70,6 +73,7 @@ func testProcess(t *testing.T) { lcdGet(t, "process/get/"+testProcessHash.String(), &p) require.True(t, p.Equal(&process.Process{ Hash: p.Hash, + Address: sdk.AccAddress(crypto.AddressHash(p.Hash)).String(), Name: req.Name, Nodes: req.Nodes, Edges: req.Edges, diff --git a/process/process.pb.go b/process/process.pb.go index cd2256555..383ce24bb 100644 --- a/process/process.pb.go +++ b/process/process.pb.go @@ -83,6 +83,7 @@ type Process struct { 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"` + Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty" hash:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -815,75 +816,77 @@ func init() { func init() { proto.RegisterFile("process.proto", fileDescriptor_54c4d0e8c0aaf5c3) } var fileDescriptor_54c4d0e8c0aaf5c3 = []byte{ - // 1086 bytes of a gzipped FileDescriptorProto + // 1109 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x97, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0xf6, 0xda, 0x8e, 0x4f, 0xdc, 0x28, 0x8c, 0x04, 0xac, 0x56, 0x25, 0x36, 0xae, - 0x20, 0x09, 0x24, 0x1b, 0x62, 0xa7, 0x2d, 0x0d, 0x17, 0x88, 0x8d, 0x5c, 0x15, 0xea, 0x86, 0xd4, + 0x14, 0xc7, 0xb3, 0xf6, 0xda, 0x8e, 0x4f, 0xdc, 0x28, 0x8c, 0x04, 0xac, 0x96, 0x12, 0x1b, 0x57, + 0x34, 0x09, 0x24, 0x1b, 0x62, 0xa7, 0x2d, 0x0d, 0x17, 0x88, 0x8d, 0x5c, 0x15, 0xea, 0x86, 0xd4, 0x34, 0x08, 0x7a, 0x13, 0x36, 0xbb, 0x63, 0x7b, 0x95, 0xcd, 0x8c, 0xbb, 0x33, 0x1b, 0x12, 0xc4, - 0x0d, 0x3c, 0x03, 0x97, 0x3c, 0x00, 0x8f, 0xd2, 0x4b, 0x04, 0xe2, 0x06, 0x21, 0x4b, 0xf4, 0x11, - 0xfc, 0x00, 0x80, 0x66, 0x66, 0xfd, 0x91, 0xd8, 0x4e, 0x36, 0xa5, 0x08, 0xa9, 0x77, 0xb1, 0x73, - 0xce, 0x6f, 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 0xfa, 0xfa, 0x3a, 0x47, 0x3e, 0xa1, 0x5b, 0xe5, 0x88, 0x30, 0xa7, 0x89, 0x25, 0x46, - 0xf9, 0x29, 0x4c, 0x05, 0xe0, 0x80, 0xd2, 0x20, 0x86, 0x88, 0xa6, 0x35, 0x3b, 0xb9, 0x2b, 0xe5, - 0x85, 0x99, 0xf2, 0x79, 0x04, 0xe9, 0x10, 0x37, 0xe3, 0xd6, 0xb4, 0x96, 0x44, 0x84, 0x06, 0x6e, - 0xe2, 0x10, 0x13, 0x17, 0x4f, 0xe9, 0x55, 0x21, 0x6e, 0x0a, 0x6d, 0x03, 0x9f, 0xf1, 0xb8, 0x53, - 0x25, 0xd2, 0xb6, 0xee, 0x33, 0x3e, 0xb9, 0x65, 0x49, 0x14, 0xda, 0x51, 0x3d, 0x34, 0x27, 0x89, - 0x4b, 0x49, 0x88, 0x93, 0xda, 0xe9, 0xed, 0x7e, 0x3b, 0x35, 0x9f, 0x80, 0x2e, 0x8e, 0x44, 0xfe, - 0xf9, 0x12, 0xbc, 0x91, 0x80, 0xfd, 0x7c, 0xc5, 0xf7, 0x4c, 0x53, 0x55, 0xff, 0xcd, 0xf9, 0x23, - 0x37, 0x13, 0x86, 0xf3, 0x02, 0x1e, 0xc0, 0x3e, 0x14, 0x46, 0x21, 0x68, 0x61, 0x64, 0x68, 0xab, - 0x69, 0x7c, 0x07, 0x32, 0xc7, 0x4e, 0x10, 0xe1, 0x78, 0x18, 0x27, 0x91, 0xa3, 0xa1, 0x3c, 0xb6, - 0x52, 0xef, 0x6b, 0xe6, 0xdf, 0x29, 0xc8, 0x0f, 0x4a, 0x04, 0x7d, 0x08, 0x39, 0xb1, 0x81, 0xdc, - 0xbf, 0xea, 0x5e, 0xd0, 0xf7, 0x42, 0x5f, 0x82, 0xde, 0x71, 0x78, 0x3b, 0xbe, 0x4c, 0xe5, 0x4a, - 0x05, 0x6a, 0xed, 0x3a, 0xbc, 0x3d, 0xe1, 0xf9, 0x35, 0x24, 0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0xd1, 0xc6, 0x64, + 0x89, 0x84, 0x07, 0xaa, 0x43, 0x36, 0xc4, 0x2c, 0x0a, 0xb8, 0x94, 0x77, 0xae, 0x52, 0x9c, 0x26, + 0x91, 0xd5, 0x90, 0x66, 0xf6, 0x2b, 0xbd, 0x6e, 0xf1, 0xca, 0x19, 0xfd, 0xef, 0xce, 0x34, 0x62, + 0x06, 0xfa, 0x18, 0x32, 0xf8, 0x18, 0x13, 0x6e, 0xa4, 0x25, 0x6c, 0x71, 0x2a, 0xac, 0x26, 0xac, + 0xc6, 0x58, 0x55, 0xc1, 0x52, 0x04, 0x74, 0x07, 0x74, 0xee, 0xb0, 0x43, 0x43, 0x97, 0xa4, 0x37, + 0xa7, 0x92, 0x1e, 0x3a, 0xec, 0x70, 0x0c, 0xb4, 0x29, 0x40, 0xd2, 0x1f, 0x6d, 0x43, 0xfa, 0xc8, + 0xe9, 0x18, 0x19, 0x89, 0xb9, 0x3a, 0x15, 0x73, 0xdf, 0xe9, 0x8c, 0x51, 0x6e, 0x08, 0x8a, 0xf0, + 0x16, 0x2a, 0x35, 0xfd, 0x80, 0xe3, 0x50, 0xa6, 0xe3, 0x22, 0x95, 0xee, 0x48, 0xb3, 0x31, 0xd4, + 0x4d, 0xa9, 0x92, 0x62, 0x98, 0xbf, 0x6a, 0x90, 0x55, 0x6a, 0xa2, 0x6f, 0xa1, 0xe0, 0x13, 0xc6, + 0x1d, 0xe2, 0x62, 0x71, 0x22, 0x64, 0x12, 0x0a, 0xf6, 0x17, 0xcf, 0x77, 0x98, 0x12, 0x1c, 0x8b, + 0x33, 0xab, 0xa1, 0x4f, 0x20, 0x27, 0x34, 0xba, 0x87, 0x4f, 0x65, 0xc2, 0xf2, 0xf6, 0x7b, 0xbd, + 0x6e, 0x71, 0xf5, 0x4c, 0x42, 0x46, 0x28, 0x9d, 0xd0, 0x27, 0xdc, 0x61, 0xae, 0xef, 0x8f, 0x14, + 0x6c, 0x1f, 0x60, 0xfe, 0xa6, 0x41, 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0xe2, 0xa6, 0xd0, + 0x36, 0xf0, 0x19, 0x8f, 0x3b, 0x55, 0x22, 0x6d, 0xeb, 0x3e, 0xe3, 0x93, 0x5b, 0x96, 0x44, 0xa1, + 0x1d, 0xd5, 0x43, 0x73, 0x92, 0xb8, 0x94, 0x84, 0x38, 0xa9, 0x9d, 0xde, 0xea, 0xb7, 0x53, 0xf3, + 0x31, 0xe8, 0x62, 0x49, 0xe4, 0x9f, 0x2f, 0xc1, 0x6b, 0x09, 0xd8, 0xcf, 0x57, 0x7c, 0x4f, 0x35, + 0x55, 0xf5, 0xdf, 0x9c, 0x5f, 0x72, 0x33, 0x61, 0x38, 0x2f, 0xe0, 0x00, 0xec, 0x43, 0x61, 0x14, + 0x82, 0x16, 0x46, 0x86, 0xb6, 0x9a, 0xc6, 0xb7, 0x21, 0x73, 0xec, 0x04, 0x11, 0x8e, 0x87, 0x71, + 0x12, 0x39, 0x1a, 0xca, 0x63, 0x2b, 0xf5, 0xbe, 0x66, 0xfe, 0x9d, 0x82, 0xfc, 0xa0, 0x44, 0xd0, + 0x87, 0x90, 0x13, 0x37, 0x95, 0x7b, 0x97, 0xbd, 0x17, 0xf4, 0xbd, 0xd0, 0x97, 0xa0, 0x77, 0x1c, + 0xde, 0x8e, 0x37, 0x53, 0xb9, 0x54, 0x81, 0x5a, 0xbb, 0x0e, 0x6f, 0x4f, 0x38, 0x7e, 0x0d, 0x89, + 0x34, 0x7f, 0xd7, 0x40, 0x17, 0x16, 0xe8, 0x83, 0xd1, 0x8b, 0xcb, 0x52, 0xaf, 0x5b, 0xbc, 0x36, + 0x6d, 0x83, 0xc3, 0xae, 0x26, 0xeb, 0x48, 0xc8, 0xb5, 0x02, 0x19, 0x9f, 0x78, 0xf8, 0x44, 0xee, + 0x50, 0x9f, 0x7c, 0xd8, 0x95, 0xc5, 0x20, 0x96, 0xf4, 0x0b, 0x8b, 0xa5, 0x1a, 0xc7, 0x62, 0x03, + 0xcc, 0x32, 0x1c, 0x60, 0x97,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, 0xe5, 0xd9, 0x57, 0x93, 0xf8, + 0x9b, 0xf0, 0x20, 0x2b, 0x3f, 0xf2, 0xaa, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x2a, 0x77, + 0xbf, 0x25, 0x0e, 0x00, 0x00, } func (this *Process) Equal(that interface{}) bool { @@ -927,6 +930,9 @@ func (this *Process) Equal(that interface{}) bool { return false } } + if this.Address != that1.Address { + return false + } if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { return false } diff --git a/protobuf/types/process.proto b/protobuf/types/process.proto index 0cb99b6a5..0237e2c64 100644 --- a/protobuf/types/process.proto +++ b/protobuf/types/process.proto @@ -236,4 +236,8 @@ message Process { repeated Edge edges = 5 [ (gogoproto.moretags) = 'hash:"name:5" validate:"dive,required"' ]; + + string address = 6 [ + (gogoproto.moretags) = 'hash:"-"' + ]; } diff --git a/x/process/internal/keeper/keeper.go b/x/process/internal/keeper/keeper.go index 8d2ce7dbd..4654b1b99 100644 --- a/x/process/internal/keeper/keeper.go +++ b/x/process/internal/keeper/keeper.go @@ -10,6 +10,7 @@ import ( "github.com/mesg-foundation/engine/process" processpb "github.com/mesg-foundation/engine/process" "github.com/mesg-foundation/engine/x/process/internal/types" + "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/libs/log" ) @@ -46,6 +47,7 @@ func (k Keeper) Create(ctx sdk.Context, msg *types.MsgCreateProcess) (*processpb Edges: msg.Request.Edges, } p.Hash = hash.Dump(p) + p.Address = sdk.AccAddress(crypto.AddressHash(p.Hash)).String() if store.Has(p.Hash) { return nil, fmt.Errorf("process %q already exists", p.Hash) }