diff --git a/Makefile b/Makefile index 70c37ff41071ec6ec4922eb9d72731116207bedf..0a61ec9dc61f786cd4d9c1fbf1f86d4ca22d6a1b 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ protobuf_deps: # Implicit compile rule for GRPC/proto files %.pb.go: %.proto - @protoc -I ./$(@D) $< --go_out=plugins=grpc:$(@D) + protoc -I ${GOPATH}/src ${REPO}/$< --go_out=plugins=grpc:${GOPATH}/src keys/pbkeys/keys.pb.go: keys/pbkeys/keys.proto @@ -83,7 +83,7 @@ protobuf: $(PROTO_GO_FILES) .PHONY: clean_protobuf clean_protobuf: - @rm $(PROTO_GO_FILES) + @rm -f $(PROTO_GO_FILES) ### Dependency management for github.com/hyperledger/burrow # erase vendor wipes the full vendor directory @@ -181,7 +181,7 @@ test_keys: build_db .PHONY: test_integration test_integration: test_keys - @go test -tags integration ./rpc/burrow/integration + @go test -tags integration ./rpc/rpctransactor/integration @go test -tags integration ./rpc/v0/integration @go test -tags integration ./rpc/tm/integration diff --git a/binary/bytes.go b/binary/bytes.go index 236ef6d402ff3585e19e9ae6b4c2531f4b61fdaa..2b0dd8d72acf783b91601e27922a062748cdec87 100644 --- a/binary/bytes.go +++ b/binary/bytes.go @@ -4,15 +4,15 @@ import "github.com/tmthrgd/go-hex" type HexBytes []byte -func (bs *HexBytes) UnmarshalText(hexBytes []byte) error { - bs2, err := hex.DecodeString(string(hexBytes)) +func (hb *HexBytes) UnmarshalText(hexBytes []byte) error { + bs, err := hex.DecodeString(string(hexBytes)) if err != nil { return err } - *bs = bs2 + *hb = bs return nil } -func (bs HexBytes) MarshalText() ([]byte, error) { - return []byte(hex.EncodeUpperToString(bs)), nil +func (hb HexBytes) MarshalText() ([]byte, error) { + return []byte(hex.EncodeUpperToString(hb)), nil } diff --git a/binary/integer_test.go b/binary/integer_test.go index 767597637d03acd8c415857ee87cbe32e1c5bd08..2f40ae258d4011e389f11fae2b706363ac7451ad 100644 --- a/binary/integer_test.go +++ b/binary/integer_test.go @@ -100,7 +100,7 @@ func TestS256(t *testing.T) { func TestPutUint64BE(t *testing.T) { bs := make([]byte, 8) PutUint64LE(bs, 245343) - assert.Equal(t, "5FBE030000000000", fmt.Sprintf("%X\n", bs)) + assert.Equal(t, "5FBE030000000000", fmt.Sprintf("%X", bs)) } func TestSignExtend(t *testing.T) { diff --git a/client/websocket_client.go b/client/websocket_client.go index ffc67d2c609ac3046b465f726bf4a48a0822a5fb..2580dc4bb0096e4241814fe806590727cd7aa342 100644 --- a/client/websocket_client.go +++ b/client/websocket_client.go @@ -152,7 +152,7 @@ func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) WaitForConfirmation( continue } - eventDataTx := resultEvent.EventDataTx + eventDataTx := resultEvent.Execution.GetTx() if eventDataTx == nil { // We are on the lookout for EventDataTx confirmationChannel <- Confirmation{ @@ -171,7 +171,7 @@ func (burrowNodeWebsocketClient *burrowNodeWebsocketClient) WaitForConfirmation( continue } - if eventDataTx.Exception != nil && eventDataTx.Exception.Code != errors.ErrorCodeExecutionReverted { + if eventDataTx.Exception != nil && eventDataTx.Exception.ErrorCode() != errors.ErrorCodeExecutionReverted { confirmationChannel <- Confirmation{ BlockHash: latestBlockHash, EventDataTx: eventDataTx, diff --git a/config/config.go b/config/config.go index 747dc208285911e028c4f9da10ca2cf6e6801444..c9958d56df2cccc1ddcbfc233db4f81bef7681fd 100644 --- a/config/config.go +++ b/config/config.go @@ -56,7 +56,7 @@ func (conf *BurrowConfig) Kernel(ctx context.Context) (*core.Kernel, error) { return nil, fmt.Errorf("could not generate logger from logging config: %v", err) } var keyClient keys.KeyClient - var keyStore keys.KeyStore + var keyStore *keys.KeyStore if conf.Keys.RemoteAddress != "" { keyClient, err = keys.NewRemoteKeyClient(conf.Keys.RemoteAddress, logger) if err != nil { @@ -86,7 +86,7 @@ func (conf *BurrowConfig) Kernel(ctx context.Context) (*core.Kernel, error) { } return core.NewKernel(ctx, keyClient, privValidator, conf.GenesisDoc, conf.Tendermint.TendermintConfig(), conf.RPC, conf.Keys, - &keyStore, exeOptions, logger) + keyStore, exeOptions, logger) } func (conf *BurrowConfig) JSONString() string { diff --git a/core/kernel.go b/core/kernel.go index 5c8577b62430218546943c53f138fb5af1420a92..51e880e999de428171f080556065af21b77afabe 100644 --- a/core/kernel.go +++ b/core/kernel.go @@ -32,6 +32,8 @@ import ( "github.com/hyperledger/burrow/consensus/tendermint/query" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution" + "github.com/hyperledger/burrow/execution/events/pbevents" + "github.com/hyperledger/burrow/execution/pbtransactor" "github.com/hyperledger/burrow/genesis" "github.com/hyperledger/burrow/keys" "github.com/hyperledger/burrow/keys/pbkeys" @@ -39,8 +41,9 @@ import ( "github.com/hyperledger/burrow/logging/structure" "github.com/hyperledger/burrow/process" "github.com/hyperledger/burrow/rpc" - "github.com/hyperledger/burrow/rpc/burrow" "github.com/hyperledger/burrow/rpc/metrics" + "github.com/hyperledger/burrow/rpc/rpcevents" + "github.com/hyperledger/burrow/rpc/rpctransactor" "github.com/hyperledger/burrow/rpc/tm" "github.com/hyperledger/burrow/rpc/v0" v0_server "github.com/hyperledger/burrow/rpc/v0/server" @@ -238,7 +241,12 @@ func NewKernel(ctx context.Context, keyClient keys.KeyClient, privValidator tm_t pbkeys.RegisterKeysServer(grpcServer, ks) } - burrow.RegisterTransactionServer(grpcServer, burrow.NewTransactionServer(service, state, txCodec)) + pbtransactor.RegisterTransactorServer(grpcServer, rpctransactor.NewTransactorServer(service.Transactor(), + service.MempoolAccounts(), state, txCodec)) + + pbevents.RegisterEventsServer(grpcServer, rpcevents.NewEventsServer(rpc.NewSubscriptions(service))) + + pbevents.RegisterExecutionEventsServer(grpcServer, rpcevents.NewExecutionEventsServer()) go grpcServer.Serve(listen) diff --git a/event/cache.go b/event/cache.go index 51009b4fd96bebdf4548d0ed635f03154bca9ce9..f2f4bfb61513b99c01cfbe49f5999a231f59b2db 100644 --- a/event/cache.go +++ b/event/cache.go @@ -40,16 +40,29 @@ func (evc *Cache) Publish(ctx context.Context, message interface{}, tags map[str return nil } -// Clears cached events by flushing them to Publisher func (evc *Cache) Flush(publisher Publisher) error { + err := evc.Sync(publisher) + if err != nil { + return err + } + evc.Reset() + return nil +} + +// Clears cached events by flushing them to Publisher +func (evc *Cache) Sync(publisher Publisher) error { var err error for _, mi := range evc.events { publishErr := publisher.Publish(mi.ctx, mi.message, mi.tags) - // Capture first by try to flush the rest + // Capture first by try to sync the rest if publishErr != nil && err == nil { err = publishErr } } + return err +} + +func (evc *Cache) Reset() { // Clear the buffer by re-slicing its length to zero if cap(evc.events) > len(evc.events)*maximumBufferCapacityToLengthRatio { // Trim the backing array capacity when it is more than double the length of the slice to avoid tying up memory @@ -60,5 +73,4 @@ func (evc *Cache) Flush(publisher Publisher) error { // in previous cache round evc.events = evc.events[:0] } - return err } diff --git a/execution/accounts.go b/execution/accounts.go index 1a9fe3aa53cb1f53217ffc1a65ecf1032cd85007..8125ef0a10d9546c8165b9c98d65b04881e7f717 100644 --- a/execution/accounts.go +++ b/execution/accounts.go @@ -88,6 +88,22 @@ func (accs *Accounts) SequentialSigningAccountFromPrivateKey(privateKeyBytes []b }, nil } +// Gets signing account from onr of private key or address - failing if both are provided +func (accs *Accounts) GetSequentialSigningAccount(address, privateKey []byte) (*SequentialSigningAccount, error) { + if len(address) > 0 { + if len(privateKey) > 0 { + return nil, fmt.Errorf("address and private key provided but only one or the other should be given") + } + address, err := crypto.AddressFromBytes(address) + if err != nil { + return nil, err + } + return accs.SequentialSigningAccount(address) + } + + return accs.SequentialSigningAccountFromPrivateKey(privateKey) +} + type UnlockFunc func() func (ssa *SequentialSigningAccount) Lock() (*SigningAccount, UnlockFunc, error) { diff --git a/execution/errors/errors.go b/execution/errors/errors.go index 7c576566c06f2233a43bcfbbfd5d047b9a2a39d2..f4c96e8054a83d716ec23210db77321269695b68 100644 --- a/execution/errors/errors.go +++ b/execution/errors/errors.go @@ -1,18 +1,19 @@ package errors import ( + "encoding/json" "fmt" ) type CodedError interface { error - ErrorCode() ErrorCode + ErrorCode() Code } -type ErrorCode int8 +type Code uint32 const ( - ErrorCodeGeneric ErrorCode = iota + ErrorCodeGeneric Code = iota ErrorCodeUnknownAddress ErrorCodeInsufficientBalance ErrorCodeInvalidJumpDest @@ -33,12 +34,12 @@ const ( ErrorCodeNativeFunction ) -func (ec ErrorCode) ErrorCode() ErrorCode { - return ec +func (c Code) ErrorCode() Code { + return c } -func (ec ErrorCode) Error() string { - switch ec { +func (c Code) Error() string { + switch c { case ErrorCodeUnknownAddress: return "Unknown address" case ErrorCodeInsufficientBalance: @@ -73,23 +74,21 @@ func (ec ErrorCode) Error() string { return "Execution reverted" case ErrorCodeNativeFunction: return "Native function error" - default: + case ErrorCodeGeneric: return "Generic error" + default: + return "Unknown error" } } -// Exception provides a serialisable coded error for the VM -type Exception struct { - Code ErrorCode - Exception string -} - -func NewCodedError(errorCode ErrorCode, exception string) *Exception { +func NewCodedError(errorCode Code, exception string) *Exception { if exception == "" { return nil } return &Exception{ - Code: errorCode, + Code: &ErrorCode{ + Code: uint32(errorCode), + }, Exception: exception, } } @@ -117,29 +116,39 @@ func Errorf(format string, a ...interface{}) CodedError { return ErrorCodef(ErrorCodeGeneric, format, a...) } -func ErrorCodef(errorCode ErrorCode, format string, a ...interface{}) CodedError { +func ErrorCodef(errorCode Code, format string, a ...interface{}) CodedError { return NewCodedError(errorCode, fmt.Sprintf(format, a...)) } func (e *Exception) AsError() error { - // thanks go, you dick + // We need to return a bare untyped error here so that err == nil downstream if e == nil { return nil } return e } -func (e *Exception) ErrorCode() ErrorCode { - return e.Code -} - -func (e *Exception) String() string { - return e.Error() +func (e *Exception) ErrorCode() Code { + return Code(e.GetCode().Code) } func (e *Exception) Error() string { if e == nil { return "" } - return fmt.Sprintf("VM Error %v: %s", e.Code, e.Exception) + return fmt.Sprintf("Error %v: %s", e.Code, e.Exception) +} + +func NewErrorCode(code Code) *ErrorCode { + return &ErrorCode{ + Code: uint32(code), + } +} + +func (e ErrorCode) MarshalJSON() ([]byte, error) { + return json.Marshal(e.Code) +} + +func (e *ErrorCode) UnmarshalJSON(bs []byte) error { + return json.Unmarshal(bs, &(e.Code)) } diff --git a/execution/errors/errors.pb.go b/execution/errors/errors.pb.go index a8925e436e5fe31743ac43e751bc50350f17b8fc..14d297a6c41cda1f905353a1f056f72b5fab3895 100644 --- a/execution/errors/errors.pb.go +++ b/execution/errors/errors.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: errors.proto +// source: github.com/hyperledger/burrow/execution/errors/errors.proto package errors @@ -31,7 +31,7 @@ func (m *Exception) Reset() { *m = Exception{} } func (m *Exception) String() string { return proto.CompactTextString(m) } func (*Exception) ProtoMessage() {} func (*Exception) Descriptor() ([]byte, []int) { - return fileDescriptor_errors_75c2645022d60ab3, []int{0} + return fileDescriptor_errors_e7e9443965b28d5d, []int{0} } func (m *Exception) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Exception.Unmarshal(m, b) @@ -83,7 +83,7 @@ func (m *ErrorCode) Reset() { *m = ErrorCode{} } func (m *ErrorCode) String() string { return proto.CompactTextString(m) } func (*ErrorCode) ProtoMessage() {} func (*ErrorCode) Descriptor() ([]byte, []int) { - return fileDescriptor_errors_75c2645022d60ab3, []int{1} + return fileDescriptor_errors_e7e9443965b28d5d, []int{1} } func (m *ErrorCode) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ErrorCode.Unmarshal(m, b) @@ -111,20 +111,25 @@ func (m *ErrorCode) GetCode() uint32 { } func init() { - proto.RegisterType((*Exception)(nil), "Exception") - proto.RegisterType((*ErrorCode)(nil), "ErrorCode") -} - -func init() { proto.RegisterFile("errors.proto", fileDescriptor_errors_75c2645022d60ab3) } - -var fileDescriptor_errors_75c2645022d60ab3 = []byte{ - // 123 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0x2d, 0x2a, 0xca, - 0x2f, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x8a, 0xe4, 0xe2, 0x74, 0xad, 0x48, 0x4e, - 0x2d, 0x28, 0xc9, 0xcc, 0xcf, 0x13, 0x92, 0xe3, 0x62, 0x71, 0xce, 0x4f, 0x49, 0x95, 0x60, 0x54, - 0x60, 0xd4, 0xe0, 0x36, 0xe2, 0xd2, 0x73, 0x05, 0xa9, 0x04, 0x89, 0x04, 0x81, 0xc5, 0x85, 0x64, - 0x90, 0x14, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0x21, 0xe9, 0xe6, 0xe3, 0x62, 0x72, 0x0a, - 0x96, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x62, 0x72, 0x0a, 0x56, 0x92, 0xe7, 0xe2, 0x84, 0x1b, - 0x20, 0x24, 0x84, 0x64, 0x34, 0x2f, 0xc4, 0xb8, 0x24, 0x36, 0xb0, 0x13, 0x8c, 0x01, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x51, 0xa4, 0x54, 0xe6, 0x92, 0x00, 0x00, 0x00, + proto.RegisterType((*Exception)(nil), "errors.Exception") + proto.RegisterType((*ErrorCode)(nil), "errors.ErrorCode") +} + +func init() { + proto.RegisterFile("github.com/hyperledger/burrow/execution/errors/errors.proto", fileDescriptor_errors_e7e9443965b28d5d) +} + +var fileDescriptor_errors_e7e9443965b28d5d = []byte{ + // 168 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xcf, 0xa8, 0x2c, 0x48, 0x2d, 0xca, 0x49, 0x4d, 0x49, + 0x4f, 0x2d, 0xd2, 0x4f, 0x2a, 0x2d, 0x2a, 0xca, 0x2f, 0xd7, 0x4f, 0xad, 0x48, 0x4d, 0x2e, 0x2d, + 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0x2d, 0x2a, 0xca, 0x2f, 0x2a, 0x86, 0x52, 0x7a, 0x05, 0x45, 0xf9, + 0x25, 0xf9, 0x42, 0x6c, 0x10, 0x9e, 0x52, 0x02, 0x17, 0xa7, 0x6b, 0x45, 0x72, 0x6a, 0x01, 0x48, + 0xa1, 0x90, 0x2a, 0x17, 0x8b, 0x73, 0x7e, 0x4a, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, + 0xa0, 0x1e, 0x54, 0x87, 0x2b, 0x88, 0x02, 0x49, 0x04, 0x81, 0xa5, 0x85, 0x64, 0x90, 0xf4, 0x48, + 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0x21, 0x19, 0xc2, 0xc7, 0xc5, 0xe4, 0x14, 0x2c, 0xc1, 0xac, + 0xc0, 0xa8, 0xc1, 0x13, 0xc4, 0xe4, 0x14, 0xac, 0x24, 0xcf, 0xc5, 0x09, 0x37, 0x40, 0x48, 0x08, + 0xc9, 0x06, 0x5e, 0x88, 0x71, 0x49, 0x6c, 0x60, 0x17, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x20, 0x37, 0xb1, 0xd9, 0xd0, 0x00, 0x00, 0x00, } diff --git a/execution/errors/errors.proto b/execution/errors/errors.proto index 0dadba49925709df6fb27eb6a2a567b4d8d5c2e3..2620fdd403e97fd1d7037ab49be92bfbb4e94bac 100644 --- a/execution/errors/errors.proto +++ b/execution/errors/errors.proto @@ -1,5 +1,7 @@ syntax = "proto3"; +package errors; + message Exception { ErrorCode Code = 1; string Exception = 2; diff --git a/execution/errors/native.go b/execution/errors/native.go index df35e9a4f1379b37c6368764156e214ed0a70087..bd64b6f75a796dc645a49d5e7337cea69dd14f74 100644 --- a/execution/errors/native.go +++ b/execution/errors/native.go @@ -15,6 +15,6 @@ func (e LacksSNativePermission) Error() string { return fmt.Sprintf("account %s does not have SNative function call permission: %s", e.Address, e.SNative) } -func (e LacksSNativePermission) ErrorCode() ErrorCode { +func (e LacksSNativePermission) ErrorCode() Code { return ErrorCodeNativeFunction } diff --git a/execution/errors/vm.go b/execution/errors/vm.go index d8b164c230fd94e490dd4bd91154fad93a68f9fb..f2d40983fd03377db7064a8716c3c2cc1bff0c6c 100644 --- a/execution/errors/vm.go +++ b/execution/errors/vm.go @@ -12,7 +12,7 @@ type PermissionDenied struct { Perm types.PermFlag } -func (err PermissionDenied) ErrorCode() ErrorCode { +func (err PermissionDenied) ErrorCode() Code { return ErrorCodePermissionDenied } @@ -24,10 +24,10 @@ type NestedCall struct { NestedError CodedError Caller crypto.Address Callee crypto.Address - StackDepth int + StackDepth uint64 } -func (err NestedCall) ErrorCode() ErrorCode { +func (err NestedCall) ErrorCode() Code { return err.NestedError.ErrorCode() } @@ -41,7 +41,7 @@ type Call struct { NestedErrors []NestedCall } -func (err Call) ErrorCode() ErrorCode { +func (err Call) ErrorCode() Code { return err.CallError.ErrorCode() } diff --git a/execution/evm/events/events.go b/execution/events/call.go similarity index 65% rename from execution/evm/events/events.go rename to execution/events/call.go index 3dcb4461060297ec4fd44f9dc57bbe4a8815b697..1640faefa1456fc9d37891a9d9f23dbc68c4c235 100644 --- a/execution/evm/events/events.go +++ b/execution/events/call.go @@ -19,7 +19,6 @@ import ( "fmt" "github.com/hyperledger/burrow/binary" - . "github.com/hyperledger/burrow/binary" "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution/errors" @@ -29,16 +28,15 @@ import ( // Functions to generate eventId strings func EventStringAccountCall(addr crypto.Address) string { return fmt.Sprintf("Acc/%s/Call", addr) } -func EventStringLogEvent(addr crypto.Address) string { return fmt.Sprintf("Log/%s", addr) } //---------------------------------------- // EventDataCall fires when we call a contract, and when a contract calls another contract type EventDataCall struct { + TxHash binary.HexBytes CallData *CallData Origin crypto.Address - TxHash binary.HexBytes - StackDepth int + StackDepth uint64 Return binary.HexBytes Exception *errors.Exception } @@ -51,15 +49,22 @@ type CallData struct { Gas uint64 } -// EventDataLog fires when a contract executes the LOG opcode -type EventDataLog struct { - Address crypto.Address - Topics []Word256 - Data binary.HexBytes - Height uint64 -} - // Publish/Subscribe +func PublishAccountCall(publisher event.Publisher, address crypto.Address, call *EventDataCall) error { + + return event.PublishWithEventID(publisher, EventStringAccountCall(address), + &Event{ + Header: &Header{ + TxHash: call.TxHash, + }, + Call: call, + }, + map[string]interface{}{ + "address": address, + event.TxHashKey: hex.EncodeUpperToString(call.TxHash), + event.StackDepthKey: call.StackDepth, + }) +} // Subscribe to account call event - if TxHash is provided listens for a specifc Tx otherwise captures all, if // stackDepth is greater than or equal to 0 captures calls at a specific stack depth (useful for capturing the return @@ -78,38 +83,10 @@ func SubscribeAccountCall(ctx context.Context, subscribable event.Subscribable, } return event.SubscribeCallback(ctx, subscribable, subscriber, query, func(message interface{}) bool { - eventDataCall, ok := message.(*EventDataCall) - if ok { - ch <- eventDataCall + ev, ok := message.(*Event) + if ok && ev.Call != nil { + ch <- ev.Call } return true }) } - -func SubscribeLogEvent(ctx context.Context, subscribable event.Subscribable, subscriber string, address crypto.Address, - ch chan<- *EventDataLog) error { - - query := event.QueryForEventID(EventStringLogEvent(address)) - - return event.SubscribeCallback(ctx, subscribable, subscriber, query, func(message interface{}) bool { - eventDataLog, ok := message.(*EventDataLog) - if ok { - ch <- eventDataLog - } - return true - }) -} - -func PublishAccountCall(publisher event.Publisher, address crypto.Address, eventDataCall *EventDataCall) error { - return event.PublishWithEventID(publisher, EventStringAccountCall(address), eventDataCall, - map[string]interface{}{ - "address": address, - event.TxHashKey: hex.EncodeUpperToString(eventDataCall.TxHash), - event.StackDepthKey: eventDataCall.StackDepth, - }) -} - -func PublishLogEvent(publisher event.Publisher, address crypto.Address, eventDataLog *EventDataLog) error { - return event.PublishWithEventID(publisher, EventStringLogEvent(address), eventDataLog, - map[string]interface{}{"address": address}) -} diff --git a/execution/events/event.go b/execution/events/event.go new file mode 100644 index 0000000000000000000000000000000000000000..cd9f99fb973604f88bf8d9f1e59bad9db34ebf21 --- /dev/null +++ b/execution/events/event.go @@ -0,0 +1,37 @@ +package events + +import "github.com/hyperledger/burrow/binary" + +type Event struct { + Header *Header + Call *EventDataCall `json:",omitempty"` + Log *EventDataLog `json:",omitempty"` + Tx *EventDataTx `json:",omitempty"` +} + +func (ev *Event) GetTx() *EventDataTx { + if ev == nil { + return nil + } + return ev.Tx +} + +func (ev *Event) GetCall() *EventDataCall { + if ev == nil { + return nil + } + return ev.Call +} + +func (ev *Event) GetLog() *EventDataLog { + if ev == nil { + return nil + } + return ev.Log +} + +type Header struct { + TxHash binary.HexBytes + Height uint64 + Index uint64 +} diff --git a/execution/events/events.pb.go b/execution/events/events.pb.go deleted file mode 100644 index 65935ac9eb0c043f25b39b629ed1471e534c567d..0000000000000000000000000000000000000000 --- a/execution/events/events.pb.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: events.proto - -package events - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -type Event struct { - Type int32 `protobuf:"varint,1,opt,name=Type,proto3" json:"Type,omitempty"` - BlockHeight uint64 `protobuf:"varint,2,opt,name=BlockHeight,proto3" json:"BlockHeight,omitempty"` - IndexInBlock uint64 `protobuf:"varint,3,opt,name=IndexInBlock,proto3" json:"IndexInBlock,omitempty"` - TxHash []byte `protobuf:"bytes,4,opt,name=TxHash,proto3" json:"TxHash,omitempty"` - EventDataTx *EventDataTx `protobuf:"bytes,5,opt,name=EventDataTx,proto3" json:"EventDataTx,omitempty"` - EventDataCall *EventDataCall `protobuf:"bytes,6,opt,name=EventDataCall,proto3" json:"EventDataCall,omitempty"` - EventDataLog *EventDataLog `protobuf:"bytes,7,opt,name=EventDataLog,proto3" json:"EventDataLog,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_events_709a76406cdd9837, []int{0} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Event.Unmarshal(m, b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) -} -func (dst *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(dst, src) -} -func (m *Event) XXX_Size() int { - return xxx_messageInfo_Event.Size(m) -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *Event) GetBlockHeight() uint64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *Event) GetIndexInBlock() uint64 { - if m != nil { - return m.IndexInBlock - } - return 0 -} - -func (m *Event) GetTxHash() []byte { - if m != nil { - return m.TxHash - } - return nil -} - -func (m *Event) GetEventDataTx() *EventDataTx { - if m != nil { - return m.EventDataTx - } - return nil -} - -func (m *Event) GetEventDataCall() *EventDataCall { - if m != nil { - return m.EventDataCall - } - return nil -} - -func (m *Event) GetEventDataLog() *EventDataLog { - if m != nil { - return m.EventDataLog - } - return nil -} - -type EventDataLog struct { - Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=Height,proto3" json:"Height,omitempty"` - Topics []string `protobuf:"bytes,4,rep,name=Topics,proto3" json:"Topics,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataLog) Reset() { *m = EventDataLog{} } -func (m *EventDataLog) String() string { return proto.CompactTextString(m) } -func (*EventDataLog) ProtoMessage() {} -func (*EventDataLog) Descriptor() ([]byte, []int) { - return fileDescriptor_events_709a76406cdd9837, []int{1} -} -func (m *EventDataLog) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataLog.Unmarshal(m, b) -} -func (m *EventDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataLog.Marshal(b, m, deterministic) -} -func (dst *EventDataLog) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataLog.Merge(dst, src) -} -func (m *EventDataLog) XXX_Size() int { - return xxx_messageInfo_EventDataLog.Size(m) -} -func (m *EventDataLog) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataLog.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataLog proto.InternalMessageInfo - -func (m *EventDataLog) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *EventDataLog) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *EventDataLog) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *EventDataLog) GetTopics() []string { - if m != nil { - return m.Topics - } - return nil -} - -type EventDataTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=Tx,proto3" json:"Tx,omitempty"` - Return []byte `protobuf:"bytes,2,opt,name=Return,proto3" json:"Return,omitempty"` - Exception string `protobuf:"bytes,3,opt,name=Exception,proto3" json:"Exception,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataTx) Reset() { *m = EventDataTx{} } -func (m *EventDataTx) String() string { return proto.CompactTextString(m) } -func (*EventDataTx) ProtoMessage() {} -func (*EventDataTx) Descriptor() ([]byte, []int) { - return fileDescriptor_events_709a76406cdd9837, []int{2} -} -func (m *EventDataTx) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataTx.Unmarshal(m, b) -} -func (m *EventDataTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataTx.Marshal(b, m, deterministic) -} -func (dst *EventDataTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataTx.Merge(dst, src) -} -func (m *EventDataTx) XXX_Size() int { - return xxx_messageInfo_EventDataTx.Size(m) -} -func (m *EventDataTx) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataTx.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataTx proto.InternalMessageInfo - -func (m *EventDataTx) GetTx() []byte { - if m != nil { - return m.Tx - } - return nil -} - -func (m *EventDataTx) GetReturn() []byte { - if m != nil { - return m.Return - } - return nil -} - -func (m *EventDataTx) GetException() string { - if m != nil { - return m.Exception - } - return "" -} - -type EventDataCall struct { - EventCallData *EventCallData `protobuf:"bytes,1,opt,name=EventCallData,proto3" json:"EventCallData,omitempty"` - Origin []byte `protobuf:"bytes,2,opt,name=Origin,proto3" json:"Origin,omitempty"` - StackDepth int64 `protobuf:"varint,3,opt,name=StackDepth,proto3" json:"StackDepth,omitempty"` - Return []byte `protobuf:"bytes,4,opt,name=Return,proto3" json:"Return,omitempty"` - Exception string `protobuf:"bytes,5,opt,name=Exception,proto3" json:"Exception,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataCall) Reset() { *m = EventDataCall{} } -func (m *EventDataCall) String() string { return proto.CompactTextString(m) } -func (*EventDataCall) ProtoMessage() {} -func (*EventDataCall) Descriptor() ([]byte, []int) { - return fileDescriptor_events_709a76406cdd9837, []int{3} -} -func (m *EventDataCall) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataCall.Unmarshal(m, b) -} -func (m *EventDataCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataCall.Marshal(b, m, deterministic) -} -func (dst *EventDataCall) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataCall.Merge(dst, src) -} -func (m *EventDataCall) XXX_Size() int { - return xxx_messageInfo_EventDataCall.Size(m) -} -func (m *EventDataCall) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataCall.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataCall proto.InternalMessageInfo - -func (m *EventDataCall) GetEventCallData() *EventCallData { - if m != nil { - return m.EventCallData - } - return nil -} - -func (m *EventDataCall) GetOrigin() []byte { - if m != nil { - return m.Origin - } - return nil -} - -func (m *EventDataCall) GetStackDepth() int64 { - if m != nil { - return m.StackDepth - } - return 0 -} - -func (m *EventDataCall) GetReturn() []byte { - if m != nil { - return m.Return - } - return nil -} - -func (m *EventDataCall) GetException() string { - if m != nil { - return m.Exception - } - return "" -} - -type EventCallData struct { - Caller []byte `protobuf:"bytes,1,opt,name=Caller,proto3" json:"Caller,omitempty"` - Callee []byte `protobuf:"bytes,2,opt,name=Callee,proto3" json:"Callee,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` - Value uint64 `protobuf:"varint,4,opt,name=Value,proto3" json:"Value,omitempty"` - Gas uint64 `protobuf:"varint,5,opt,name=Gas,proto3" json:"Gas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventCallData) Reset() { *m = EventCallData{} } -func (m *EventCallData) String() string { return proto.CompactTextString(m) } -func (*EventCallData) ProtoMessage() {} -func (*EventCallData) Descriptor() ([]byte, []int) { - return fileDescriptor_events_709a76406cdd9837, []int{4} -} -func (m *EventCallData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventCallData.Unmarshal(m, b) -} -func (m *EventCallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventCallData.Marshal(b, m, deterministic) -} -func (dst *EventCallData) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventCallData.Merge(dst, src) -} -func (m *EventCallData) XXX_Size() int { - return xxx_messageInfo_EventCallData.Size(m) -} -func (m *EventCallData) XXX_DiscardUnknown() { - xxx_messageInfo_EventCallData.DiscardUnknown(m) -} - -var xxx_messageInfo_EventCallData proto.InternalMessageInfo - -func (m *EventCallData) GetCaller() []byte { - if m != nil { - return m.Caller - } - return nil -} - -func (m *EventCallData) GetCallee() []byte { - if m != nil { - return m.Callee - } - return nil -} - -func (m *EventCallData) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *EventCallData) GetValue() uint64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *EventCallData) GetGas() uint64 { - if m != nil { - return m.Gas - } - return 0 -} - -func init() { - proto.RegisterType((*Event)(nil), "Event") - proto.RegisterType((*EventDataLog)(nil), "EventDataLog") - proto.RegisterType((*EventDataTx)(nil), "EventDataTx") - proto.RegisterType((*EventDataCall)(nil), "EventDataCall") - proto.RegisterType((*EventCallData)(nil), "EventCallData") -} - -func init() { proto.RegisterFile("events.proto", fileDescriptor_events_709a76406cdd9837) } - -var fileDescriptor_events_709a76406cdd9837 = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xdf, 0x6a, 0xa3, 0x40, - 0x14, 0xc6, 0xf1, 0x5f, 0x42, 0x4e, 0x4c, 0x58, 0x86, 0x65, 0x99, 0x8b, 0x65, 0x11, 0xaf, 0xbc, - 0x12, 0xf6, 0xcf, 0x0b, 0xec, 0x6e, 0x42, 0x13, 0x28, 0x14, 0x4e, 0xa4, 0xf7, 0xd6, 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 0x1a, 0xaa, 0x3a, 0xcf, 0x5a, 0xee, 0x06, 0x4e, 0x34, 0x43, 0xad, - 0xc2, 0xdd, 0xa8, 0x06, 0xb6, 0x04, 0x3b, 0xe9, 0xb4, 0x8f, 0x9d, 0x74, 0xea, 0x0c, 0x85, 0x3c, - 0x37, 0xa5, 0x36, 0xd1, 0x8a, 0x7d, 0x87, 0xd9, 0xba, 0xcb, 0x44, 0x2d, 0xf3, 0xaa, 0x24, 0xa7, - 0x19, 0xbe, 0x83, 0xf0, 0xd5, 0xba, 0x2a, 0x6b, 0x68, 0x4f, 0x09, 0xca, 0x6c, 0x99, 0xed, 0x5d, - 0x28, 0x8e, 0x97, 0x94, 0xfb, 0x5d, 0x93, 0x1f, 0xf2, 0xc1, 0xbd, 0x57, 0xec, 0x07, 0xc0, 0x4e, - 0xa6, 0xd9, 0x69, 0x25, 0x6a, 0x79, 0x24, 0x7b, 0x07, 0x0d, 0x62, 0xa4, 0x76, 0x3f, 0x4f, 0xed, - 0x5d, 0xa7, 0x7e, 0x86, 0x8f, 0xf6, 0x6a, 0x16, 0x8d, 0x2e, 0x44, 0xab, 0x81, 0x8b, 0x4b, 0xac, - 0x5e, 0x0d, 0xef, 0xe1, 0x18, 0xef, 0xf1, 0x15, 0xbc, 0xfb, 0xb4, 0x38, 0x0b, 0x4a, 0xe2, 0x62, - 0x2f, 0xd8, 0x17, 0x70, 0x6e, 0xd2, 0x96, 0x22, 0xb8, 0xa8, 0xc6, 0x87, 0x09, 0xfd, 0x11, 0xbf, - 0xdf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x50, 0xa1, 0x17, 0x5d, 0x21, 0x03, 0x00, 0x00, -} diff --git a/execution/events/events.proto b/execution/events/events.proto deleted file mode 100644 index e7dd8565a1e22bfe877e4c56aa04e2ef7e6fb048..0000000000000000000000000000000000000000 --- a/execution/events/events.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -message Event { - int32 Type = 1; // This message is missing the tendermint object part. this might not be important? - uint64 BlockHeight = 2; - uint64 IndexInBlock = 3; - bytes TxHash = 4; - EventDataTx EventDataTx = 5; - EventDataCall EventDataCall = 6; - EventDataLog EventDataLog = 7; -} - -message EventDataLog { - bytes Address = 1; - bytes Data = 2; - uint64 Height = 3; - repeated string Topics = 4; -} - -message EventDataTx { - bytes Tx = 1; - bytes Return = 2; - string Exception = 3; -} - -message EventDataCall { - EventCallData EventCallData = 1; - bytes Origin = 2; - int64 StackDepth = 3; - bytes Return = 4; - string Exception = 5; -} - -message EventCallData { - bytes Caller = 1; - bytes Callee = 2; - bytes Data = 3; - uint64 Value = 4; - uint64 Gas = 5; -} diff --git a/execution/events/log.go b/execution/events/log.go new file mode 100644 index 0000000000000000000000000000000000000000..1ad55c9e3d3cb46ef36505f8db6c6a27b78c63e4 --- /dev/null +++ b/execution/events/log.go @@ -0,0 +1,67 @@ +// Copyright 2017 Monax Industries Limited +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package events + +import ( + "context" + "fmt" + + "github.com/hyperledger/burrow/binary" + . "github.com/hyperledger/burrow/binary" + "github.com/hyperledger/burrow/crypto" + "github.com/hyperledger/burrow/event" +) + +// Functions to generate eventId strings + +func EventStringLogEvent(addr crypto.Address) string { return fmt.Sprintf("Log/%s", addr) } + +//---------------------------------------- + +// EventDataLog fires when a contract executes the LOG opcode +type EventDataLog struct { + TxHash binary.HexBytes + Address crypto.Address + Topics []Word256 + Data binary.HexBytes + Height uint64 +} + +// Publish/Subscribe +func PublishLogEvent(publisher event.Publisher, address crypto.Address, log *EventDataLog) error { + + return event.PublishWithEventID(publisher, EventStringLogEvent(address), + &Event{ + Header: &Header{ + TxHash: log.TxHash, + }, + Log: log, + }, + map[string]interface{}{"address": address}) +} + +func SubscribeLogEvent(ctx context.Context, subscribable event.Subscribable, subscriber string, address crypto.Address, + ch chan<- *EventDataLog) error { + + query := event.QueryForEventID(EventStringLogEvent(address)) + + return event.SubscribeCallback(ctx, subscribable, subscriber, query, func(message interface{}) bool { + ev, ok := message.(*Event) + if ok && ev.Log != nil { + ch <- ev.Log + } + return true + }) +} diff --git a/execution/events/pbevents/events.go b/execution/events/pbevents/events.go new file mode 100644 index 0000000000000000000000000000000000000000..99958308b8da9469f0b8e2cece979e6b83018db9 --- /dev/null +++ b/execution/events/pbevents/events.go @@ -0,0 +1,88 @@ +package pbevents + +import ( + "github.com/hyperledger/burrow/binary" + "github.com/hyperledger/burrow/execution/events" +) + +func GetEventDataCall(edt *events.EventDataCall) *EventDataCall { + return &EventDataCall{ + Origin: edt.Origin.Bytes(), + CallData: GetCallData(edt.CallData), + StackDepth: edt.StackDepth, + Return: edt.Return, + Exception: edt.Exception, + } +} + +func GetCallData(cd *events.CallData) *CallData { + return &CallData{ + Caller: cd.Caller.Bytes(), + Callee: cd.Callee.Bytes(), + Data: cd.Data, + Gas: cd.Gas, + } +} + +func GetEvent(event interface{}) *ExecutionEvent { + switch ev := event.(type) { + case *events.Event: + return &ExecutionEvent{ + Header: GetEventHeader(ev.Header), + EventData: GetEventData(ev), + } + default: + return nil + } +} + +func GetEventHeader(header *events.Header) *EventHeader { + return &EventHeader{ + TxHash: header.TxHash, + Height: header.Height, + Index: header.Index, + } +} + +func GetEventData(ev *events.Event) isExecutionEvent_EventData { + if ev.Call != nil { + return &ExecutionEvent_EventDataCall{ + EventDataCall: &EventDataCall{ + CallData: GetCallData(ev.Call.CallData), + Origin: ev.Call.Origin.Bytes(), + StackDepth: ev.Call.StackDepth, + Return: ev.Call.Return, + Exception: ev.Call.Exception, + }, + } + } + + if ev.Log != nil { + return &ExecutionEvent_EventDataLog{ + EventDataLog: &EventDataLog{ + Address: ev.Log.Address.Bytes(), + Data: ev.Log.Data, + Topics: GetTopic(ev.Log.Topics), + }, + } + } + + if ev.Tx != nil { + return &ExecutionEvent_EventDataTx{ + EventDataTx: &EventDataTx{ + Return: ev.Tx.Return, + Exception: ev.Tx.Exception, + }, + } + } + + return nil +} + +func GetTopic(topics []binary.Word256) [][]byte { + topicBytes := make([][]byte, len(topics)) + for i, t := range topics { + topicBytes[i] = t.Bytes() + } + return topicBytes +} diff --git a/execution/events/pbevents/events.pb.go b/execution/events/pbevents/events.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..c1c6c2c4735546356d25c83c6b53b4442f07f9a3 --- /dev/null +++ b/execution/events/pbevents/events.pb.go @@ -0,0 +1,1053 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: github.com/hyperledger/burrow/execution/events/pbevents/events.proto + +package pbevents // import "github.com/hyperledger/burrow/execution/events/pbevents" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import errors "github.com/hyperledger/burrow/execution/errors" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// Params +type EventIdParam struct { + EventId string `protobuf:"bytes,1,opt,name=eventId,proto3" json:"eventId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventIdParam) Reset() { *m = EventIdParam{} } +func (m *EventIdParam) String() string { return proto.CompactTextString(m) } +func (*EventIdParam) ProtoMessage() {} +func (*EventIdParam) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{0} +} +func (m *EventIdParam) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventIdParam.Unmarshal(m, b) +} +func (m *EventIdParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventIdParam.Marshal(b, m, deterministic) +} +func (dst *EventIdParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventIdParam.Merge(dst, src) +} +func (m *EventIdParam) XXX_Size() int { + return xxx_messageInfo_EventIdParam.Size(m) +} +func (m *EventIdParam) XXX_DiscardUnknown() { + xxx_messageInfo_EventIdParam.DiscardUnknown(m) +} + +var xxx_messageInfo_EventIdParam proto.InternalMessageInfo + +func (m *EventIdParam) GetEventId() string { + if m != nil { + return m.EventId + } + return "" +} + +type SubIdParam struct { + SubId string `protobuf:"bytes,1,opt,name=subId,proto3" json:"subId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubIdParam) Reset() { *m = SubIdParam{} } +func (m *SubIdParam) String() string { return proto.CompactTextString(m) } +func (*SubIdParam) ProtoMessage() {} +func (*SubIdParam) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{1} +} +func (m *SubIdParam) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubIdParam.Unmarshal(m, b) +} +func (m *SubIdParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubIdParam.Marshal(b, m, deterministic) +} +func (dst *SubIdParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubIdParam.Merge(dst, src) +} +func (m *SubIdParam) XXX_Size() int { + return xxx_messageInfo_SubIdParam.Size(m) +} +func (m *SubIdParam) XXX_DiscardUnknown() { + xxx_messageInfo_SubIdParam.DiscardUnknown(m) +} + +var xxx_messageInfo_SubIdParam proto.InternalMessageInfo + +func (m *SubIdParam) GetSubId() string { + if m != nil { + return m.SubId + } + return "" +} + +// Results +type EventUnSub struct { + Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventUnSub) Reset() { *m = EventUnSub{} } +func (m *EventUnSub) String() string { return proto.CompactTextString(m) } +func (*EventUnSub) ProtoMessage() {} +func (*EventUnSub) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{2} +} +func (m *EventUnSub) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventUnSub.Unmarshal(m, b) +} +func (m *EventUnSub) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventUnSub.Marshal(b, m, deterministic) +} +func (dst *EventUnSub) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUnSub.Merge(dst, src) +} +func (m *EventUnSub) XXX_Size() int { + return xxx_messageInfo_EventUnSub.Size(m) +} +func (m *EventUnSub) XXX_DiscardUnknown() { + xxx_messageInfo_EventUnSub.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUnSub proto.InternalMessageInfo + +func (m *EventUnSub) GetResult() bool { + if m != nil { + return m.Result + } + return false +} + +type PollResponse struct { + Events []*ExecutionEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PollResponse) Reset() { *m = PollResponse{} } +func (m *PollResponse) String() string { return proto.CompactTextString(m) } +func (*PollResponse) ProtoMessage() {} +func (*PollResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{3} +} +func (m *PollResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PollResponse.Unmarshal(m, b) +} +func (m *PollResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PollResponse.Marshal(b, m, deterministic) +} +func (dst *PollResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PollResponse.Merge(dst, src) +} +func (m *PollResponse) XXX_Size() int { + return xxx_messageInfo_PollResponse.Size(m) +} +func (m *PollResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PollResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PollResponse proto.InternalMessageInfo + +func (m *PollResponse) GetEvents() []*ExecutionEvent { + if m != nil { + return m.Events + } + return nil +} + +type GetEventsRequest struct { + BlockRange *BlockRange `protobuf:"bytes,1,opt,name=BlockRange,proto3" json:"BlockRange,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEventsRequest) Reset() { *m = GetEventsRequest{} } +func (m *GetEventsRequest) String() string { return proto.CompactTextString(m) } +func (*GetEventsRequest) ProtoMessage() {} +func (*GetEventsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{4} +} +func (m *GetEventsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetEventsRequest.Unmarshal(m, b) +} +func (m *GetEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetEventsRequest.Marshal(b, m, deterministic) +} +func (dst *GetEventsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEventsRequest.Merge(dst, src) +} +func (m *GetEventsRequest) XXX_Size() int { + return xxx_messageInfo_GetEventsRequest.Size(m) +} +func (m *GetEventsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetEventsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEventsRequest proto.InternalMessageInfo + +func (m *GetEventsRequest) GetBlockRange() *BlockRange { + if m != nil { + return m.BlockRange + } + return nil +} + +type GetEventsResponse struct { + Events []*ExecutionEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetEventsResponse) Reset() { *m = GetEventsResponse{} } +func (m *GetEventsResponse) String() string { return proto.CompactTextString(m) } +func (*GetEventsResponse) ProtoMessage() {} +func (*GetEventsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{5} +} +func (m *GetEventsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetEventsResponse.Unmarshal(m, b) +} +func (m *GetEventsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetEventsResponse.Marshal(b, m, deterministic) +} +func (dst *GetEventsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetEventsResponse.Merge(dst, src) +} +func (m *GetEventsResponse) XXX_Size() int { + return xxx_messageInfo_GetEventsResponse.Size(m) +} +func (m *GetEventsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetEventsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetEventsResponse proto.InternalMessageInfo + +func (m *GetEventsResponse) GetEvents() []*ExecutionEvent { + if m != nil { + return m.Events + } + return nil +} + +// An inclusive range of blocks to include +type BlockRange struct { + StartBlock uint64 `protobuf:"varint,1,opt,name=StartBlock,proto3" json:"StartBlock,omitempty"` + FinalBlock uint64 `protobuf:"varint,2,opt,name=FinalBlock,proto3" json:"FinalBlock,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockRange) Reset() { *m = BlockRange{} } +func (m *BlockRange) String() string { return proto.CompactTextString(m) } +func (*BlockRange) ProtoMessage() {} +func (*BlockRange) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{6} +} +func (m *BlockRange) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockRange.Unmarshal(m, b) +} +func (m *BlockRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockRange.Marshal(b, m, deterministic) +} +func (dst *BlockRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockRange.Merge(dst, src) +} +func (m *BlockRange) XXX_Size() int { + return xxx_messageInfo_BlockRange.Size(m) +} +func (m *BlockRange) XXX_DiscardUnknown() { + xxx_messageInfo_BlockRange.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockRange proto.InternalMessageInfo + +func (m *BlockRange) GetStartBlock() uint64 { + if m != nil { + return m.StartBlock + } + return 0 +} + +func (m *BlockRange) GetFinalBlock() uint64 { + if m != nil { + return m.FinalBlock + } + return 0 +} + +type EventHeader struct { + // The hash of the transaction that caused this event to be generated + TxHash []byte `protobuf:"bytes,1,opt,name=TxHash,proto3" json:"TxHash,omitempty"` + // The block height at which this event was emitted + Height uint64 `protobuf:"varint,2,opt,name=Height,proto3" json:"Height,omitempty"` + // The index amongst all other events in the block of this event + Index uint64 `protobuf:"varint,3,opt,name=Index,proto3" json:"Index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventHeader) Reset() { *m = EventHeader{} } +func (m *EventHeader) String() string { return proto.CompactTextString(m) } +func (*EventHeader) ProtoMessage() {} +func (*EventHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{7} +} +func (m *EventHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventHeader.Unmarshal(m, b) +} +func (m *EventHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventHeader.Marshal(b, m, deterministic) +} +func (dst *EventHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventHeader.Merge(dst, src) +} +func (m *EventHeader) XXX_Size() int { + return xxx_messageInfo_EventHeader.Size(m) +} +func (m *EventHeader) XXX_DiscardUnknown() { + xxx_messageInfo_EventHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_EventHeader proto.InternalMessageInfo + +func (m *EventHeader) GetTxHash() []byte { + if m != nil { + return m.TxHash + } + return nil +} + +func (m *EventHeader) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *EventHeader) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +// -------------------------------------------------- +// Event types +type ExecutionEvent struct { + Header *EventHeader `protobuf:"bytes,1,opt,name=Header,proto3" json:"Header,omitempty"` + // Types that are valid to be assigned to EventData: + // *ExecutionEvent_EventDataTx + // *ExecutionEvent_EventDataCall + // *ExecutionEvent_EventDataLog + EventData isExecutionEvent_EventData `protobuf_oneof:"EventData"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExecutionEvent) Reset() { *m = ExecutionEvent{} } +func (m *ExecutionEvent) String() string { return proto.CompactTextString(m) } +func (*ExecutionEvent) ProtoMessage() {} +func (*ExecutionEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{8} +} +func (m *ExecutionEvent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ExecutionEvent.Unmarshal(m, b) +} +func (m *ExecutionEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ExecutionEvent.Marshal(b, m, deterministic) +} +func (dst *ExecutionEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExecutionEvent.Merge(dst, src) +} +func (m *ExecutionEvent) XXX_Size() int { + return xxx_messageInfo_ExecutionEvent.Size(m) +} +func (m *ExecutionEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ExecutionEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ExecutionEvent proto.InternalMessageInfo + +type isExecutionEvent_EventData interface { + isExecutionEvent_EventData() +} + +type ExecutionEvent_EventDataTx struct { + EventDataTx *EventDataTx `protobuf:"bytes,2,opt,name=EventDataTx,proto3,oneof"` +} +type ExecutionEvent_EventDataCall struct { + EventDataCall *EventDataCall `protobuf:"bytes,3,opt,name=EventDataCall,proto3,oneof"` +} +type ExecutionEvent_EventDataLog struct { + EventDataLog *EventDataLog `protobuf:"bytes,4,opt,name=EventDataLog,proto3,oneof"` +} + +func (*ExecutionEvent_EventDataTx) isExecutionEvent_EventData() {} +func (*ExecutionEvent_EventDataCall) isExecutionEvent_EventData() {} +func (*ExecutionEvent_EventDataLog) isExecutionEvent_EventData() {} + +func (m *ExecutionEvent) GetEventData() isExecutionEvent_EventData { + if m != nil { + return m.EventData + } + return nil +} + +func (m *ExecutionEvent) GetHeader() *EventHeader { + if m != nil { + return m.Header + } + return nil +} + +func (m *ExecutionEvent) GetEventDataTx() *EventDataTx { + if x, ok := m.GetEventData().(*ExecutionEvent_EventDataTx); ok { + return x.EventDataTx + } + return nil +} + +func (m *ExecutionEvent) GetEventDataCall() *EventDataCall { + if x, ok := m.GetEventData().(*ExecutionEvent_EventDataCall); ok { + return x.EventDataCall + } + return nil +} + +func (m *ExecutionEvent) GetEventDataLog() *EventDataLog { + if x, ok := m.GetEventData().(*ExecutionEvent_EventDataLog); ok { + return x.EventDataLog + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ExecutionEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ExecutionEvent_OneofMarshaler, _ExecutionEvent_OneofUnmarshaler, _ExecutionEvent_OneofSizer, []interface{}{ + (*ExecutionEvent_EventDataTx)(nil), + (*ExecutionEvent_EventDataCall)(nil), + (*ExecutionEvent_EventDataLog)(nil), + } +} + +func _ExecutionEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ExecutionEvent) + // EventData + switch x := m.EventData.(type) { + case *ExecutionEvent_EventDataTx: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EventDataTx); err != nil { + return err + } + case *ExecutionEvent_EventDataCall: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EventDataCall); err != nil { + return err + } + case *ExecutionEvent_EventDataLog: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.EventDataLog); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ExecutionEvent.EventData has unexpected type %T", x) + } + return nil +} + +func _ExecutionEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ExecutionEvent) + switch tag { + case 2: // EventData.EventDataTx + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EventDataTx) + err := b.DecodeMessage(msg) + m.EventData = &ExecutionEvent_EventDataTx{msg} + return true, err + case 3: // EventData.EventDataCall + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EventDataCall) + err := b.DecodeMessage(msg) + m.EventData = &ExecutionEvent_EventDataCall{msg} + return true, err + case 4: // EventData.EventDataLog + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EventDataLog) + err := b.DecodeMessage(msg) + m.EventData = &ExecutionEvent_EventDataLog{msg} + return true, err + default: + return false, nil + } +} + +func _ExecutionEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ExecutionEvent) + // EventData + switch x := m.EventData.(type) { + case *ExecutionEvent_EventDataTx: + s := proto.Size(x.EventDataTx) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecutionEvent_EventDataCall: + s := proto.Size(x.EventDataCall) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ExecutionEvent_EventDataLog: + s := proto.Size(x.EventDataLog) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type EventDataLog struct { + Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` + Topics [][]byte `protobuf:"bytes,3,rep,name=Topics,proto3" json:"Topics,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventDataLog) Reset() { *m = EventDataLog{} } +func (m *EventDataLog) String() string { return proto.CompactTextString(m) } +func (*EventDataLog) ProtoMessage() {} +func (*EventDataLog) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{9} +} +func (m *EventDataLog) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventDataLog.Unmarshal(m, b) +} +func (m *EventDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventDataLog.Marshal(b, m, deterministic) +} +func (dst *EventDataLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDataLog.Merge(dst, src) +} +func (m *EventDataLog) XXX_Size() int { + return xxx_messageInfo_EventDataLog.Size(m) +} +func (m *EventDataLog) XXX_DiscardUnknown() { + xxx_messageInfo_EventDataLog.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDataLog proto.InternalMessageInfo + +func (m *EventDataLog) GetAddress() []byte { + if m != nil { + return m.Address + } + return nil +} + +func (m *EventDataLog) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *EventDataLog) GetTopics() [][]byte { + if m != nil { + return m.Topics + } + return nil +} + +type EventDataTx struct { + Return []byte `protobuf:"bytes,1,opt,name=Return,proto3" json:"Return,omitempty"` + Exception *errors.Exception `protobuf:"bytes,2,opt,name=Exception,proto3" json:"Exception,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventDataTx) Reset() { *m = EventDataTx{} } +func (m *EventDataTx) String() string { return proto.CompactTextString(m) } +func (*EventDataTx) ProtoMessage() {} +func (*EventDataTx) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{10} +} +func (m *EventDataTx) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventDataTx.Unmarshal(m, b) +} +func (m *EventDataTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventDataTx.Marshal(b, m, deterministic) +} +func (dst *EventDataTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDataTx.Merge(dst, src) +} +func (m *EventDataTx) XXX_Size() int { + return xxx_messageInfo_EventDataTx.Size(m) +} +func (m *EventDataTx) XXX_DiscardUnknown() { + xxx_messageInfo_EventDataTx.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDataTx proto.InternalMessageInfo + +func (m *EventDataTx) GetReturn() []byte { + if m != nil { + return m.Return + } + return nil +} + +func (m *EventDataTx) GetException() *errors.Exception { + if m != nil { + return m.Exception + } + return nil +} + +type EventDataCall struct { + CallData *CallData `protobuf:"bytes,1,opt,name=CallData,proto3" json:"CallData,omitempty"` + Origin []byte `protobuf:"bytes,2,opt,name=Origin,proto3" json:"Origin,omitempty"` + StackDepth uint64 `protobuf:"varint,3,opt,name=StackDepth,proto3" json:"StackDepth,omitempty"` + Return []byte `protobuf:"bytes,4,opt,name=Return,proto3" json:"Return,omitempty"` + Exception *errors.Exception `protobuf:"bytes,5,opt,name=Exception,proto3" json:"Exception,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EventDataCall) Reset() { *m = EventDataCall{} } +func (m *EventDataCall) String() string { return proto.CompactTextString(m) } +func (*EventDataCall) ProtoMessage() {} +func (*EventDataCall) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{11} +} +func (m *EventDataCall) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EventDataCall.Unmarshal(m, b) +} +func (m *EventDataCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EventDataCall.Marshal(b, m, deterministic) +} +func (dst *EventDataCall) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDataCall.Merge(dst, src) +} +func (m *EventDataCall) XXX_Size() int { + return xxx_messageInfo_EventDataCall.Size(m) +} +func (m *EventDataCall) XXX_DiscardUnknown() { + xxx_messageInfo_EventDataCall.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDataCall proto.InternalMessageInfo + +func (m *EventDataCall) GetCallData() *CallData { + if m != nil { + return m.CallData + } + return nil +} + +func (m *EventDataCall) GetOrigin() []byte { + if m != nil { + return m.Origin + } + return nil +} + +func (m *EventDataCall) GetStackDepth() uint64 { + if m != nil { + return m.StackDepth + } + return 0 +} + +func (m *EventDataCall) GetReturn() []byte { + if m != nil { + return m.Return + } + return nil +} + +func (m *EventDataCall) GetException() *errors.Exception { + if m != nil { + return m.Exception + } + return nil +} + +type CallData struct { + Caller []byte `protobuf:"bytes,1,opt,name=Caller,proto3" json:"Caller,omitempty"` + Callee []byte `protobuf:"bytes,2,opt,name=Callee,proto3" json:"Callee,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` + Value uint64 `protobuf:"varint,4,opt,name=Value,proto3" json:"Value,omitempty"` + Gas uint64 `protobuf:"varint,5,opt,name=Gas,proto3" json:"Gas,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CallData) Reset() { *m = CallData{} } +func (m *CallData) String() string { return proto.CompactTextString(m) } +func (*CallData) ProtoMessage() {} +func (*CallData) Descriptor() ([]byte, []int) { + return fileDescriptor_events_6fac182aceb87b11, []int{12} +} +func (m *CallData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CallData.Unmarshal(m, b) +} +func (m *CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CallData.Marshal(b, m, deterministic) +} +func (dst *CallData) XXX_Merge(src proto.Message) { + xxx_messageInfo_CallData.Merge(dst, src) +} +func (m *CallData) XXX_Size() int { + return xxx_messageInfo_CallData.Size(m) +} +func (m *CallData) XXX_DiscardUnknown() { + xxx_messageInfo_CallData.DiscardUnknown(m) +} + +var xxx_messageInfo_CallData proto.InternalMessageInfo + +func (m *CallData) GetCaller() []byte { + if m != nil { + return m.Caller + } + return nil +} + +func (m *CallData) GetCallee() []byte { + if m != nil { + return m.Callee + } + return nil +} + +func (m *CallData) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *CallData) GetValue() uint64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *CallData) GetGas() uint64 { + if m != nil { + return m.Gas + } + return 0 +} + +func init() { + proto.RegisterType((*EventIdParam)(nil), "pbevents.EventIdParam") + proto.RegisterType((*SubIdParam)(nil), "pbevents.SubIdParam") + proto.RegisterType((*EventUnSub)(nil), "pbevents.EventUnSub") + proto.RegisterType((*PollResponse)(nil), "pbevents.PollResponse") + proto.RegisterType((*GetEventsRequest)(nil), "pbevents.GetEventsRequest") + proto.RegisterType((*GetEventsResponse)(nil), "pbevents.GetEventsResponse") + proto.RegisterType((*BlockRange)(nil), "pbevents.BlockRange") + proto.RegisterType((*EventHeader)(nil), "pbevents.EventHeader") + proto.RegisterType((*ExecutionEvent)(nil), "pbevents.ExecutionEvent") + proto.RegisterType((*EventDataLog)(nil), "pbevents.EventDataLog") + proto.RegisterType((*EventDataTx)(nil), "pbevents.EventDataTx") + proto.RegisterType((*EventDataCall)(nil), "pbevents.EventDataCall") + proto.RegisterType((*CallData)(nil), "pbevents.CallData") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// EventsClient is the client API for Events service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type EventsClient interface { + EventPoll(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*PollResponse, error) + EventSubscribe(ctx context.Context, in *EventIdParam, opts ...grpc.CallOption) (*SubIdParam, error) + EventUnsubscribe(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*EventUnSub, error) +} + +type eventsClient struct { + cc *grpc.ClientConn +} + +func NewEventsClient(cc *grpc.ClientConn) EventsClient { + return &eventsClient{cc} +} + +func (c *eventsClient) EventPoll(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*PollResponse, error) { + out := new(PollResponse) + err := c.cc.Invoke(ctx, "/pbevents.Events/EventPoll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eventsClient) EventSubscribe(ctx context.Context, in *EventIdParam, opts ...grpc.CallOption) (*SubIdParam, error) { + out := new(SubIdParam) + err := c.cc.Invoke(ctx, "/pbevents.Events/EventSubscribe", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eventsClient) EventUnsubscribe(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*EventUnSub, error) { + out := new(EventUnSub) + err := c.cc.Invoke(ctx, "/pbevents.Events/EventUnsubscribe", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EventsServer is the server API for Events service. +type EventsServer interface { + EventPoll(context.Context, *SubIdParam) (*PollResponse, error) + EventSubscribe(context.Context, *EventIdParam) (*SubIdParam, error) + EventUnsubscribe(context.Context, *SubIdParam) (*EventUnSub, error) +} + +func RegisterEventsServer(s *grpc.Server, srv EventsServer) { + s.RegisterService(&_Events_serviceDesc, srv) +} + +func _Events_EventPoll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubIdParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventsServer).EventPoll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbevents.Events/EventPoll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventsServer).EventPoll(ctx, req.(*SubIdParam)) + } + return interceptor(ctx, in, info, handler) +} + +func _Events_EventSubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EventIdParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventsServer).EventSubscribe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbevents.Events/EventSubscribe", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventsServer).EventSubscribe(ctx, req.(*EventIdParam)) + } + return interceptor(ctx, in, info, handler) +} + +func _Events_EventUnsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubIdParam) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EventsServer).EventUnsubscribe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbevents.Events/EventUnsubscribe", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EventsServer).EventUnsubscribe(ctx, req.(*SubIdParam)) + } + return interceptor(ctx, in, info, handler) +} + +var _Events_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pbevents.Events", + HandlerType: (*EventsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EventPoll", + Handler: _Events_EventPoll_Handler, + }, + { + MethodName: "EventSubscribe", + Handler: _Events_EventSubscribe_Handler, + }, + { + MethodName: "EventUnsubscribe", + Handler: _Events_EventUnsubscribe_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/hyperledger/burrow/execution/events/pbevents/events.proto", +} + +// ExecutionEventsClient is the client API for ExecutionEvents service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ExecutionEventsClient interface { + GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) +} + +type executionEventsClient struct { + cc *grpc.ClientConn +} + +func NewExecutionEventsClient(cc *grpc.ClientConn) ExecutionEventsClient { + return &executionEventsClient{cc} +} + +func (c *executionEventsClient) GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error) { + out := new(GetEventsResponse) + err := c.cc.Invoke(ctx, "/pbevents.ExecutionEvents/GetEvents", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ExecutionEventsServer is the server API for ExecutionEvents service. +type ExecutionEventsServer interface { + GetEvents(context.Context, *GetEventsRequest) (*GetEventsResponse, error) +} + +func RegisterExecutionEventsServer(s *grpc.Server, srv ExecutionEventsServer) { + s.RegisterService(&_ExecutionEvents_serviceDesc, srv) +} + +func _ExecutionEvents_GetEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionEventsServer).GetEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbevents.ExecutionEvents/GetEvents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionEventsServer).GetEvents(ctx, req.(*GetEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ExecutionEvents_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pbevents.ExecutionEvents", + HandlerType: (*ExecutionEventsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetEvents", + Handler: _ExecutionEvents_GetEvents_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "github.com/hyperledger/burrow/execution/events/pbevents/events.proto", +} + +func init() { + proto.RegisterFile("github.com/hyperledger/burrow/execution/events/pbevents/events.proto", fileDescriptor_events_6fac182aceb87b11) +} + +var fileDescriptor_events_6fac182aceb87b11 = []byte{ + // 692 bytes of a gzipped FileDescriptorPro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xef, 0x66, 0xe4, 0x7a, 0xd4, 0xa0, 0xc2, 0x8e, 0xb9, 0x48, 0x8d, 0x8a, 0x16, + 0x34, 0x2b, 0x2d, 0xe8, 0xc3, 0xd6, 0x95, 0x1b, 0x65, 0xa8, 0x74, 0xb5, 0xa8, 0x06, 0x64, 0x17, + 0x9a, 0xa7, 0x2e, 0x57, 0x82, 0x5a, 0x54, 0xbe, 0x8e, 0x7f, 0x37, 0xa0, 0xad, 0xbf, 0x6c, 0x72, + 0x64, 0x06, 0x40, 0xee, 0x1d, 0x52, 0xd9, 0x0a, 0xe5, 0x46, 0x1b, 0x54, 0x66, 0xa9, 0xb6, 0x9d, + 0x8e, 0x61, 0x47, 0x1d, 0x9d, 0x65, 0x1e, 0xf7, 0x59, 0xe8, 0x21, 0x59, 0x9d, 0xba, 0x9c, 0x61, + 0x2d, 0x2f, 0x39, 0x86, 0x5d, 0xb3, 0x13, 0x79, 0xc1, 0xb0, 0x5e, 0x41, 0x7f, 0x85, 0x57, 0x6d, + 0xd1, 0xf1, 0x17, 0x78, 0x50, 0xff, 0x6c, 0x39, 0x99, 0x40, 0xa7, 0x58, 0x5a, 0x64, 0x50, 0x9e, + 0x5a, 0xdd, 0x89, 0x83, 0xc7, 0x6b, 0x7d, 0x3a, 0xb1, 0x93, 0xa3, 0xaf, 0xaf, 0xee, 0xf9, 0x27, + 0xf2, 0xda, 0xea, 0xe7, 0xf1, 0xe2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x19, 0xb9, 0x08, + 0xcb, 0x06, 0x00, 0x00, +} diff --git a/execution/events/pbevents/events.proto b/execution/events/pbevents/events.proto new file mode 100644 index 0000000000000000000000000000000000000000..e6586d9da99ed3e31947e18cdfc0c2761978b234 --- /dev/null +++ b/execution/events/pbevents/events.proto @@ -0,0 +1,100 @@ +syntax = 'proto3'; + +option go_package = "github.com/hyperledger/burrow/execution/events/pbevents"; + +import "github.com/hyperledger/burrow/execution/errors/errors.proto"; + +package pbevents; + +//-------------------------------------------------- +// Event Service Definition +service Events { + rpc EventPoll (SubIdParam) returns (PollResponse); + rpc EventSubscribe (EventIdParam) returns (SubIdParam); + rpc EventUnsubscribe (SubIdParam) returns (EventUnSub); +} + +// Params +message EventIdParam { + string eventId = 1; +} + +message SubIdParam { + string subId = 1; +} + +// Results +message EventUnSub { + bool result = 1; +} + +message PollResponse { + repeated ExecutionEvent events = 1; +} + +//-------------------------------------------------- +// Event dump + +service ExecutionEvents { + rpc GetEvents (GetEventsRequest) returns (GetEventsResponse); +} + +message GetEventsRequest { + BlockRange BlockRange = 1; +} + +message GetEventsResponse { + repeated ExecutionEvent events = 1; +} + +// An inclusive range of blocks to include +message BlockRange { + uint64 StartBlock = 1; + uint64 FinalBlock = 2; +} + +message EventHeader { + // The hash of the transaction that caused this event to be generated + bytes TxHash = 1; + // The block height at which this event was emitted + uint64 Height = 2; + // The index amongst all other events in the block of this event + uint64 Index = 3; +} +//-------------------------------------------------- +// Event types +message ExecutionEvent { + EventHeader Header = 1; + oneof EventData { + EventDataTx EventDataTx = 2; + EventDataCall EventDataCall = 3; + EventDataLog EventDataLog = 4; + } +} + +message EventDataLog { + bytes Address = 1; + bytes Data = 2; + repeated bytes Topics = 3; +} + +message EventDataTx { + bytes Return = 1; + errors.Exception Exception = 2; +} + +message EventDataCall { + CallData CallData = 1; + bytes Origin = 2; + uint64 StackDepth = 3; + bytes Return = 4; + errors.Exception Exception = 5; +} + +message CallData { + bytes Caller = 1; + bytes Callee = 2; + bytes Data = 3; + uint64 Value = 4; + uint64 Gas = 5; +} diff --git a/execution/events/events.go b/execution/events/tx.go similarity index 87% rename from execution/events/events.go rename to execution/events/tx.go index 1efdda9f26f528de4a93deb445499ab97e88b1b7..a544b4f7774db5f2fa2cf634e47e6c7a11925d16 100644 --- a/execution/events/events.go +++ b/execution/events/tx.go @@ -3,7 +3,6 @@ package events import ( "context" "fmt" - "reflect" "github.com/hyperledger/burrow/binary" "github.com/hyperledger/burrow/crypto" @@ -21,7 +20,6 @@ func EventStringNameReg(name string) string { return fmt.Sprintf(" func EventStringPermissions(perm ptypes.PermFlag) string { return fmt.Sprintf("Permissions/%v", perm) } func EventStringBond() string { return "Bond" } func EventStringUnbond() string { return "Unbond" } -func EventStringRebond() string { return "Rebond" } // All txs fire EventDataTx, but only CallTx might have Return or Exception type EventDataTx struct { @@ -32,39 +30,17 @@ type EventDataTx struct { // For re-use var sendTxQuery = event.NewQueryBuilder(). - AndEquals(event.MessageTypeKey, reflect.TypeOf(&EventDataTx{}).String()). AndEquals(event.TxTypeKey, payload.TypeSend.String()) var callTxQuery = event.NewQueryBuilder(). - AndEquals(event.MessageTypeKey, reflect.TypeOf(&EventDataTx{}).String()). AndEquals(event.TxTypeKey, payload.TypeCall.String()) // Publish/Subscribe -func SubscribeAccountOutputSendTx(ctx context.Context, subscribable event.Subscribable, subscriber string, - address crypto.Address, txHash []byte, ch chan<- *payload.SendTx) error { - - query := sendTxQuery.And(event.QueryForEventID(EventStringAccountOutput(address))). - AndEquals(event.TxHashKey, hex.EncodeUpperToString(txHash)) - - return event.SubscribeCallback(ctx, subscribable, subscriber, query, func(message interface{}) bool { - if edt, ok := message.(*EventDataTx); ok { - if sendTx, ok := edt.Tx.Payload.(*payload.SendTx); ok { - ch <- sendTx - } - } - return true - }) -} - func PublishAccountOutput(publisher event.Publisher, address crypto.Address, tx *txs.Tx, ret []byte, exception *errors.Exception) error { return event.PublishWithEventID(publisher, EventStringAccountOutput(address), - &EventDataTx{ - Tx: tx, - Return: ret, - Exception: exception, - }, + eventDataTx(tx, ret, exception), map[string]interface{}{ "address": address, event.TxTypeKey: tx.Type().String(), @@ -76,11 +52,7 @@ func PublishAccountInput(publisher event.Publisher, address crypto.Address, tx * exception *errors.Exception) error { return event.PublishWithEventID(publisher, EventStringAccountInput(address), - &EventDataTx{ - Tx: tx, - Return: ret, - Exception: exception, - }, + eventDataTx(tx, ret, exception), map[string]interface{}{ "address": address, event.TxTypeKey: tx.Type().String(), @@ -93,7 +65,8 @@ func PublishNameReg(publisher event.Publisher, tx *txs.Tx) error { if !ok { return fmt.Errorf("Tx payload must be NameTx to PublishNameReg") } - return event.PublishWithEventID(publisher, EventStringNameReg(nameTx.Name), &EventDataTx{Tx: tx}, + return event.PublishWithEventID(publisher, EventStringNameReg(nameTx.Name), + eventDataTx(tx, nil, nil), map[string]interface{}{ "name": nameTx.Name, event.TxTypeKey: tx.Type().String(), @@ -106,10 +79,40 @@ func PublishPermissions(publisher event.Publisher, perm ptypes.PermFlag, tx *txs if !ok { return fmt.Errorf("Tx payload must be PermissionsTx to PublishPermissions") } - return event.PublishWithEventID(publisher, EventStringPermissions(perm), &EventDataTx{Tx: tx}, + return event.PublishWithEventID(publisher, EventStringPermissions(perm), + eventDataTx(tx, nil, nil), map[string]interface{}{ "name": perm.String(), event.TxTypeKey: tx.Type().String(), event.TxHashKey: hex.EncodeUpperToString(tx.Hash()), }) } + +func SubscribeAccountOutputSendTx(ctx context.Context, subscribable event.Subscribable, subscriber string, + address crypto.Address, txHash []byte, ch chan<- *payload.SendTx) error { + + query := sendTxQuery.And(event.QueryForEventID(EventStringAccountOutput(address))). + AndEquals(event.TxHashKey, hex.EncodeUpperToString(txHash)) + + return event.SubscribeCallback(ctx, subscribable, subscriber, query, func(message interface{}) bool { + if ev, ok := message.(*Event); ok && ev.Tx != nil { + if sendTx, ok := ev.Tx.Tx.Payload.(*payload.SendTx); ok { + ch <- sendTx + } + } + return true + }) +} + +func eventDataTx(tx *txs.Tx, ret []byte, exception *errors.Exception) *Event { + return &Event{ + Header: &Header{ + TxHash: tx.Hash(), + }, + Tx: &EventDataTx{ + Tx: tx, + Return: ret, + Exception: exception, + }, + } +} diff --git a/execution/evm/log_event_test.go b/execution/evm/log_event_test.go index 500a97e7a9335a7c9bc7fc4137c7b8c9e41b7119..e90b51eddd0def2710ec61ea8da268d80c036753 100644 --- a/execution/evm/log_event_test.go +++ b/execution/evm/log_event_test.go @@ -26,8 +26,8 @@ import ( . "github.com/hyperledger/burrow/binary" "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" + "github.com/hyperledger/burrow/execution/events" . "github.com/hyperledger/burrow/execution/evm/asm" - "github.com/hyperledger/burrow/execution/evm/events" "github.com/hyperledger/burrow/logging" "github.com/stretchr/testify/require" ) diff --git a/execution/evm/vm.go b/execution/evm/vm.go index ec4eb07e1e02f96ec6116da7ff978b8474a02efc..df6b1eeeb4c922cbd71f9e273b7943839ece7fec 100644 --- a/execution/evm/vm.go +++ b/execution/evm/vm.go @@ -27,8 +27,8 @@ import ( "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution/errors" + "github.com/hyperledger/burrow/execution/events" . "github.com/hyperledger/burrow/execution/evm/asm" - "github.com/hyperledger/burrow/execution/evm/events" "github.com/hyperledger/burrow/execution/evm/sha3" "github.com/hyperledger/burrow/logging" ptypes "github.com/hyperledger/burrow/permission/types" @@ -51,7 +51,7 @@ type VM struct { params Params origin crypto.Address txHash []byte - stackDepth int + stackDepth uint64 nestedCallErrors []errors.NestedCall publisher event.Publisher logger *logging.Logger @@ -841,6 +841,7 @@ func (vm *VM) call(callState state.Cache, caller acm.Account, callee acm.Mutable } if vm.publisher != nil { events.PublishLogEvent(vm.publisher, callee.Address(), &events.EventDataLog{ + TxHash: vm.txHash, Address: callee.Address(), Topics: topics, Data: data, diff --git a/execution/evm/vm_test.go b/execution/evm/vm_test.go index b7752b66c324ece4cc1d0f97d4f497934084e3cb..374e760941528dccbd041a5b7652d143b832a88f 100644 --- a/execution/evm/vm_test.go +++ b/execution/evm/vm_test.go @@ -28,9 +28,9 @@ import ( "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution/errors" + "github.com/hyperledger/burrow/execution/events" . "github.com/hyperledger/burrow/execution/evm/asm" . "github.com/hyperledger/burrow/execution/evm/asm/bc" - evm_events "github.com/hyperledger/burrow/execution/evm/events" "github.com/hyperledger/burrow/logging" "github.com/hyperledger/burrow/permission" ptypes "github.com/hyperledger/burrow/permission/types" @@ -1014,7 +1014,7 @@ func makeAccountWithCode(accountUpdater state.AccountUpdater, name string, // at least 1 AccCall event) func runVMWaitError(vmCache state.Cache, ourVm *VM, caller, callee acm.MutableAccount, subscribeAddr crypto.Address, contractCode []byte, gas uint64) ([]byte, error) { - eventCh := make(chan *evm_events.EventDataCall) + eventCh := make(chan *events.EventDataCall) output, err := runVM(eventCh, vmCache, ourVm, caller, callee, subscribeAddr, contractCode, gas) if err != nil { return output, err @@ -1030,25 +1030,25 @@ func runVMWaitError(vmCache state.Cache, ourVm *VM, caller, callee acm.MutableAc // Subscribes to an AccCall, runs the vm, returns the output and any direct // exception -func runVM(eventCh chan<- *evm_events.EventDataCall, vmCache state.Cache, ourVm *VM, caller, callee acm.MutableAccount, +func runVM(eventCh chan<- *events.EventDataCall, vmCache state.Cache, ourVm *VM, caller, callee acm.MutableAccount, subscribeAddr crypto.Address, contractCode []byte, gas uint64) ([]byte, error) { // we need to catch the event from the CALL to check for exceptions - emitter := event.NewEmitter(logging.NewNoopLogger()) + em := event.NewEmitter(logging.NewNoopLogger()) fmt.Printf("subscribe to %s\n", subscribeAddr) - err := evm_events.SubscribeAccountCall(context.Background(), emitter, "test", subscribeAddr, + err := events.SubscribeAccountCall(context.Background(), em, "test", subscribeAddr, nil, -1, eventCh) if err != nil { return nil, err } - evc := event.NewEventCache(emitter) + evc := event.NewEventCache() ourVm.SetPublisher(evc) start := time.Now() output, err := ourVm.Call(vmCache, caller, callee, contractCode, []byte{}, 0, &gas) fmt.Printf("Output: %v Error: %v\n", output, err) fmt.Println("Call took:", time.Since(start)) - evc.Flush() + evc.Flush(em) return output, err } diff --git a/execution/execution.go b/execution/execution.go index 0a5087317607e6be83887a57cbaa7d5851b070ae..715f109fdcf7b220844769672703528f8fc01cbc 100644 --- a/execution/execution.go +++ b/execution/execution.go @@ -195,10 +195,10 @@ func (exe *executor) Commit() (hash []byte, err error) { if err != nil { return nil, err } - err = exe.eventCache.Flush(exe.state) - if err != nil { - return nil, err - } + //err = exe.eventCache.Sync(exe.state) + //if err != nil { + // return nil, err + //} // save state to disk err = exe.state.Save() if err != nil { diff --git a/execution/execution_test.go b/execution/execution_test.go index 4a0116d42b18802f96f702c4ebcdd61ea6ea8862..f67a278d8707b6796ac90bc7b2d0e0fca6767db1 100644 --- a/execution/execution_test.go +++ b/execution/execution_test.go @@ -31,10 +31,10 @@ import ( "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution/errors" + "github.com/hyperledger/burrow/execution/events" "github.com/hyperledger/burrow/execution/evm" . "github.com/hyperledger/burrow/execution/evm/asm" "github.com/hyperledger/burrow/execution/evm/asm/bc" - evm_events "github.com/hyperledger/burrow/execution/evm/events" "github.com/hyperledger/burrow/execution/evm/sha3" "github.com/hyperledger/burrow/execution/names" "github.com/hyperledger/burrow/genesis" @@ -1585,12 +1585,12 @@ func TestSelfDestruct(t *testing.T) { } } -func signAndExecute(t *testing.T, shoudlFail bool, exe BatchExecutor, chainID string, tx payload.Payload, +func signAndExecute(t *testing.T, shouldFail bool, exe BatchExecutor, chainID string, tx payload.Payload, signers ...acm.AddressableSigner) *txs.Envelope { env := txs.Enclose(chainID, tx) require.NoError(t, env.Sign(signers...), "Could not sign tx in call: %s", debug.Stack()) - if shoudlFail { + if shouldFail { require.Error(t, exe.Execute(env), "Tx should fail in call: %s", debug.Stack()) } else { require.NoError(t, exe.Execute(env), "Could not execute tx in call: %s", debug.Stack()) @@ -1659,13 +1659,12 @@ var ExceptionTimeOut = errors.NewCodedError(errors.ErrorCodeGeneric, "timed out // run ExecTx and wait for the Call event on given addr // returns the msg data and an error/exception func execTxWaitAccountCall(t *testing.T, batchCommitter *executor, emitter event.Emitter, txEnv *txs.Envelope, - address crypto.Address) (*evm_events.EventDataCall, error) { + address crypto.Address) (*events.EventDataCall, error) { - ch := make(chan *evm_events.EventDataCall) + ch := make(chan *events.EventDataCall) ctx := context.Background() - const subscriber = "exexTxWaitEvent" - //emitter.Subscribe(ctx, subscriber, event.QueryForEventID(eventid), ch) - evm_events.SubscribeAccountCall(ctx, emitter, subscriber, address, txEnv.Tx.Hash(), -1, ch) + const subscriber = "execTxWaitEvent" + events.SubscribeAccountCall(ctx, emitter, subscriber, address, txEnv.Tx.Hash(), -1, ch) defer emitter.UnsubscribeAll(ctx, subscriber) err := batchCommitter.Execute(txEnv) if err != nil { @@ -1710,7 +1709,7 @@ func testSNativeCALL(t *testing.T, expectPass bool, batchCommitter *executor, em tx, _ := payload.NewCallTx(batchCommitter.stateCache, users[0].PublicKey(), &dougAddress, data, 100, 10000, 100) txEnv := txs.Enclose(testChainID, tx) require.NoError(t, txEnv.Sign(users[0])) - t.Logf("subscribing to %v", evm_events.EventStringAccountCall(snativeAddress)) + t.Logf("subscribing to %v", events.EventStringAccountCall(snativeAddress)) ev, err := execTxWaitAccountCall(t, batchCommitter, emitter, txEnv, snativeAddress) if err == ExceptionTimeOut { t.Fatal("Timed out waiting for event") diff --git a/rpc/burrow/transaction.pb.go b/execution/pbtransactor/transactor.pb.go similarity index 53% rename from rpc/burrow/transaction.pb.go rename to execution/pbtransactor/transactor.pb.go index 2bb2447262772358aeba8088f737bd3827b4eb00..b6f10a44c0ff1a23401c059609eb33bed5fba0b1 100644 --- a/rpc/burrow/transaction.pb.go +++ b/execution/pbtransactor/transactor.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: transaction.proto +// source: github.com/hyperledger/burrow/execution/pbtransactor/transactor.proto -package burrow +package pbtransactor // import "github.com/hyperledger/burrow/execution/pbtransactor" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import pbevents "github.com/hyperledger/burrow/execution/events/pbevents" import ( context "golang.org/x/net/context" @@ -37,7 +38,7 @@ func (m *CallParam) Reset() { *m = CallParam{} } func (m *CallParam) String() string { return proto.CompactTextString(m) } func (*CallParam) ProtoMessage() {} func (*CallParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{0} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{0} } func (m *CallParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CallParam.Unmarshal(m, b) @@ -91,7 +92,7 @@ func (m *CallCodeParam) Reset() { *m = CallCodeParam{} } func (m *CallCodeParam) String() string { return proto.CompactTextString(m) } func (*CallCodeParam) ProtoMessage() {} func (*CallCodeParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{1} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{1} } func (m *CallCodeParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CallCodeParam.Unmarshal(m, b) @@ -147,7 +148,7 @@ func (m *TransactParam) Reset() { *m = TransactParam{} } func (m *TransactParam) String() string { return proto.CompactTextString(m) } func (*TransactParam) ProtoMessage() {} func (*TransactParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{2} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{2} } func (m *TransactParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransactParam.Unmarshal(m, b) @@ -215,7 +216,7 @@ func (m *SendParam) Reset() { *m = SendParam{} } func (m *SendParam) String() string { return proto.CompactTextString(m) } func (*SendParam) ProtoMessage() {} func (*SendParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{3} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{3} } func (m *SendParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendParam.Unmarshal(m, b) @@ -267,7 +268,7 @@ func (m *TxParam) Reset() { *m = TxParam{} } func (m *TxParam) String() string { return proto.CompactTextString(m) } func (*TxParam) ProtoMessage() {} func (*TxParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{4} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{4} } func (m *TxParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TxParam.Unmarshal(m, b) @@ -306,7 +307,7 @@ func (m *SignTxParam) Reset() { *m = SignTxParam{} } func (m *SignTxParam) String() string { return proto.CompactTextString(m) } func (*SignTxParam) ProtoMessage() {} func (*SignTxParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{5} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{5} } func (m *SignTxParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignTxParam.Unmarshal(m, b) @@ -352,7 +353,7 @@ func (m *SignedTx) Reset() { *m = SignedTx{} } func (m *SignedTx) String() string { return proto.CompactTextString(m) } func (*SignedTx) ProtoMessage() {} func (*SignedTx) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{6} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{6} } func (m *SignedTx) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignedTx.Unmarshal(m, b) @@ -391,7 +392,7 @@ func (m *CallResult) Reset() { *m = CallResult{} } func (m *CallResult) String() string { return proto.CompactTextString(m) } func (*CallResult) ProtoMessage() {} func (*CallResult) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_8daa2d775e90c023, []int{7} + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{7} } func (m *CallResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CallResult.Unmarshal(m, b) @@ -425,15 +426,156 @@ func (m *CallResult) GetGasUsed() uint64 { return 0 } +type TxReceipt struct { + TxHash []byte `protobuf:"bytes,1,opt,name=TxHash,proto3" json:"TxHash,omitempty"` + CreatesContract bool `protobuf:"varint,2,opt,name=CreatesContract,proto3" json:"CreatesContract,omitempty"` + ContractAddress []byte `protobuf:"bytes,3,opt,name=ContractAddress,proto3" json:"ContractAddress,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxReceipt) Reset() { *m = TxReceipt{} } +func (m *TxReceipt) String() string { return proto.CompactTextString(m) } +func (*TxReceipt) ProtoMessage() {} +func (*TxReceipt) Descriptor() ([]byte, []int) { + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{8} +} +func (m *TxReceipt) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TxReceipt.Unmarshal(m, b) +} +func (m *TxReceipt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TxReceipt.Marshal(b, m, deterministic) +} +func (dst *TxReceipt) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxReceipt.Merge(dst, src) +} +func (m *TxReceipt) XXX_Size() int { + return xxx_messageInfo_TxReceipt.Size(m) +} +func (m *TxReceipt) XXX_DiscardUnknown() { + xxx_messageInfo_TxReceipt.DiscardUnknown(m) +} + +var xxx_messageInfo_TxReceipt proto.InternalMessageInfo + +func (m *TxReceipt) GetTxHash() []byte { + if m != nil { + return m.TxHash + } + return nil +} + +func (m *TxReceipt) GetCreatesContract() bool { + if m != nil { + return m.CreatesContract + } + return false +} + +func (m *TxReceipt) GetContractAddress() []byte { + if m != nil { + return m.ContractAddress + } + return nil +} + +type InputAccount struct { + PrivateKey []byte `protobuf:"bytes,1,opt,name=privateKey,proto3" json:"privateKey,omitempty"` + Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InputAccount) Reset() { *m = InputAccount{} } +func (m *InputAccount) String() string { return proto.CompactTextString(m) } +func (*InputAccount) ProtoMessage() {} +func (*InputAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{9} +} +func (m *InputAccount) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InputAccount.Unmarshal(m, b) +} +func (m *InputAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InputAccount.Marshal(b, m, deterministic) +} +func (dst *InputAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_InputAccount.Merge(dst, src) +} +func (m *InputAccount) XXX_Size() int { + return xxx_messageInfo_InputAccount.Size(m) +} +func (m *InputAccount) XXX_DiscardUnknown() { + xxx_messageInfo_InputAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_InputAccount proto.InternalMessageInfo + +func (m *InputAccount) GetPrivateKey() []byte { + if m != nil { + return m.PrivateKey + } + return nil +} + +func (m *InputAccount) GetAddress() []byte { + if m != nil { + return m.Address + } + return nil +} + +type PrivateAccount struct { + PrivateKey []byte `protobuf:"bytes,1,opt,name=PrivateKey,proto3" json:"PrivateKey,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PrivateAccount) Reset() { *m = PrivateAccount{} } +func (m *PrivateAccount) String() string { return proto.CompactTextString(m) } +func (*PrivateAccount) ProtoMessage() {} +func (*PrivateAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_transactor_abf3bfc7b34ac7c7, []int{10} +} +func (m *PrivateAccount) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PrivateAccount.Unmarshal(m, b) +} +func (m *PrivateAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PrivateAccount.Marshal(b, m, deterministic) +} +func (dst *PrivateAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrivateAccount.Merge(dst, src) +} +func (m *PrivateAccount) XXX_Size() int { + return xxx_messageInfo_PrivateAccount.Size(m) +} +func (m *PrivateAccount) XXX_DiscardUnknown() { + xxx_messageInfo_PrivateAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_PrivateAccount proto.InternalMessageInfo + +func (m *PrivateAccount) GetPrivateKey() []byte { + if m != nil { + return m.PrivateKey + } + return nil +} + func init() { - proto.RegisterType((*CallParam)(nil), "CallParam") - proto.RegisterType((*CallCodeParam)(nil), "CallCodeParam") - proto.RegisterType((*TransactParam)(nil), "TransactParam") - proto.RegisterType((*SendParam)(nil), "SendParam") - proto.RegisterType((*TxParam)(nil), "TxParam") - proto.RegisterType((*SignTxParam)(nil), "SignTxParam") - proto.RegisterType((*SignedTx)(nil), "SignedTx") - proto.RegisterType((*CallResult)(nil), "CallResult") + proto.RegisterType((*CallParam)(nil), "pbtransactor.CallParam") + proto.RegisterType((*CallCodeParam)(nil), "pbtransactor.CallCodeParam") + proto.RegisterType((*TransactParam)(nil), "pbtransactor.TransactParam") + proto.RegisterType((*SendParam)(nil), "pbtransactor.SendParam") + proto.RegisterType((*TxParam)(nil), "pbtransactor.TxParam") + proto.RegisterType((*SignTxParam)(nil), "pbtransactor.SignTxParam") + proto.RegisterType((*SignedTx)(nil), "pbtransactor.SignedTx") + proto.RegisterType((*CallResult)(nil), "pbtransactor.CallResult") + proto.RegisterType((*TxReceipt)(nil), "pbtransactor.TxReceipt") + proto.RegisterType((*InputAccount)(nil), "pbtransactor.InputAccount") + proto.RegisterType((*PrivateAccount)(nil), "pbtransactor.PrivateAccount") } // Reference imports to suppress errors if they are not otherwise used. @@ -444,333 +586,344 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// TransactionClient is the client API for Transaction service. +// TransactorClient is the client API for Transactor service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TransactionClient interface { +type TransactorClient interface { BroadcastTx(ctx context.Context, in *TxParam, opts ...grpc.CallOption) (*TxReceipt, error) Call(ctx context.Context, in *CallParam, opts ...grpc.CallOption) (*CallResult, error) CallCode(ctx context.Context, in *CallCodeParam, opts ...grpc.CallOption) (*CallResult, error) Transact(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*TxReceipt, error) - TransactAndHold(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*EventDataCall, error) + TransactAndHold(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*pbevents.EventDataCall, error) Send(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) SendAndHold(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) SignTx(ctx context.Context, in *SignTxParam, opts ...grpc.CallOption) (*SignedTx, error) } -type transactionClient struct { +type transactorClient struct { cc *grpc.ClientConn } -func NewTransactionClient(cc *grpc.ClientConn) TransactionClient { - return &transactionClient{cc} +func NewTransactorClient(cc *grpc.ClientConn) TransactorClient { + return &transactorClient{cc} } -func (c *transactionClient) BroadcastTx(ctx context.Context, in *TxParam, opts ...grpc.CallOption) (*TxReceipt, error) { +func (c *transactorClient) BroadcastTx(ctx context.Context, in *TxParam, opts ...grpc.CallOption) (*TxReceipt, error) { out := new(TxReceipt) - err := c.cc.Invoke(ctx, "/Transaction/BroadcastTx", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/BroadcastTx", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) Call(ctx context.Context, in *CallParam, opts ...grpc.CallOption) (*CallResult, error) { +func (c *transactorClient) Call(ctx context.Context, in *CallParam, opts ...grpc.CallOption) (*CallResult, error) { out := new(CallResult) - err := c.cc.Invoke(ctx, "/Transaction/Call", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/Call", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) CallCode(ctx context.Context, in *CallCodeParam, opts ...grpc.CallOption) (*CallResult, error) { +func (c *transactorClient) CallCode(ctx context.Context, in *CallCodeParam, opts ...grpc.CallOption) (*CallResult, error) { out := new(CallResult) - err := c.cc.Invoke(ctx, "/Transaction/CallCode", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/CallCode", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) Transact(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*TxReceipt, error) { +func (c *transactorClient) Transact(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*TxReceipt, error) { out := new(TxReceipt) - err := c.cc.Invoke(ctx, "/Transaction/Transact", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/Transact", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) TransactAndHold(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*EventDataCall, error) { - out := new(EventDataCall) - err := c.cc.Invoke(ctx, "/Transaction/TransactAndHold", in, out, opts...) +func (c *transactorClient) TransactAndHold(ctx context.Context, in *TransactParam, opts ...grpc.CallOption) (*pbevents.EventDataCall, error) { + out := new(pbevents.EventDataCall) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/TransactAndHold", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) Send(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) { +func (c *transactorClient) Send(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) { out := new(TxReceipt) - err := c.cc.Invoke(ctx, "/Transaction/Send", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/Send", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) SendAndHold(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) { +func (c *transactorClient) SendAndHold(ctx context.Context, in *SendParam, opts ...grpc.CallOption) (*TxReceipt, error) { out := new(TxReceipt) - err := c.cc.Invoke(ctx, "/Transaction/SendAndHold", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/SendAndHold", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *transactionClient) SignTx(ctx context.Context, in *SignTxParam, opts ...grpc.CallOption) (*SignedTx, error) { +func (c *transactorClient) SignTx(ctx context.Context, in *SignTxParam, opts ...grpc.CallOption) (*SignedTx, error) { out := new(SignedTx) - err := c.cc.Invoke(ctx, "/Transaction/SignTx", in, out, opts...) + err := c.cc.Invoke(ctx, "/pbtransactor.Transactor/SignTx", in, out, opts...) if err != nil { return nil, err } return out, nil } -// TransactionServer is the server API for Transaction service. -type TransactionServer interface { +// TransactorServer is the server API for Transactor service. +type TransactorServer interface { BroadcastTx(context.Context, *TxParam) (*TxReceipt, error) Call(context.Context, *CallParam) (*CallResult, error) CallCode(context.Context, *CallCodeParam) (*CallResult, error) Transact(context.Context, *TransactParam) (*TxReceipt, error) - TransactAndHold(context.Context, *TransactParam) (*EventDataCall, error) + TransactAndHold(context.Context, *TransactParam) (*pbevents.EventDataCall, error) Send(context.Context, *SendParam) (*TxReceipt, error) SendAndHold(context.Context, *SendParam) (*TxReceipt, error) SignTx(context.Context, *SignTxParam) (*SignedTx, error) } -func RegisterTransactionServer(s *grpc.Server, srv TransactionServer) { - s.RegisterService(&_Transaction_serviceDesc, srv) +func RegisterTransactorServer(s *grpc.Server, srv TransactorServer) { + s.RegisterService(&_Transactor_serviceDesc, srv) } -func _Transaction_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TxParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).BroadcastTx(ctx, in) + return srv.(TransactorServer).BroadcastTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/BroadcastTx", + FullMethod: "/pbtransactor.Transactor/BroadcastTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).BroadcastTx(ctx, req.(*TxParam)) + return srv.(TransactorServer).BroadcastTx(ctx, req.(*TxParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CallParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).Call(ctx, in) + return srv.(TransactorServer).Call(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/Call", + FullMethod: "/pbtransactor.Transactor/Call", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).Call(ctx, req.(*CallParam)) + return srv.(TransactorServer).Call(ctx, req.(*CallParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_CallCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_CallCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CallCodeParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).CallCode(ctx, in) + return srv.(TransactorServer).CallCode(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/CallCode", + FullMethod: "/pbtransactor.Transactor/CallCode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).CallCode(ctx, req.(*CallCodeParam)) + return srv.(TransactorServer).CallCode(ctx, req.(*CallCodeParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_Transact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_Transact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TransactParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).Transact(ctx, in) + return srv.(TransactorServer).Transact(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/Transact", + FullMethod: "/pbtransactor.Transactor/Transact", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).Transact(ctx, req.(*TransactParam)) + return srv.(TransactorServer).Transact(ctx, req.(*TransactParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_TransactAndHold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_TransactAndHold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TransactParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).TransactAndHold(ctx, in) + return srv.(TransactorServer).TransactAndHold(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/TransactAndHold", + FullMethod: "/pbtransactor.Transactor/TransactAndHold", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).TransactAndHold(ctx, req.(*TransactParam)) + return srv.(TransactorServer).TransactAndHold(ctx, req.(*TransactParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SendParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).Send(ctx, in) + return srv.(TransactorServer).Send(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/Send", + FullMethod: "/pbtransactor.Transactor/Send", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).Send(ctx, req.(*SendParam)) + return srv.(TransactorServer).Send(ctx, req.(*SendParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_SendAndHold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_SendAndHold_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SendParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).SendAndHold(ctx, in) + return srv.(TransactorServer).SendAndHold(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/SendAndHold", + FullMethod: "/pbtransactor.Transactor/SendAndHold", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).SendAndHold(ctx, req.(*SendParam)) + return srv.(TransactorServer).SendAndHold(ctx, req.(*SendParam)) } return interceptor(ctx, in, info, handler) } -func _Transaction_SignTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Transactor_SignTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignTxParam) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(TransactionServer).SignTx(ctx, in) + return srv.(TransactorServer).SignTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/Transaction/SignTx", + FullMethod: "/pbtransactor.Transactor/SignTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TransactionServer).SignTx(ctx, req.(*SignTxParam)) + return srv.(TransactorServer).SignTx(ctx, req.(*SignTxParam)) } return interceptor(ctx, in, info, handler) } -var _Transaction_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Transaction", - HandlerType: (*TransactionServer)(nil), +var _Transactor_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pbtransactor.Transactor", + HandlerType: (*TransactorServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "BroadcastTx", - Handler: _Transaction_BroadcastTx_Handler, + Handler: _Transactor_BroadcastTx_Handler, }, { MethodName: "Call", - Handler: _Transaction_Call_Handler, + Handler: _Transactor_Call_Handler, }, { MethodName: "CallCode", - Handler: _Transaction_CallCode_Handler, + Handler: _Transactor_CallCode_Handler, }, { MethodName: "Transact", - Handler: _Transaction_Transact_Handler, + Handler: _Transactor_Transact_Handler, }, { MethodName: "TransactAndHold", - Handler: _Transaction_TransactAndHold_Handler, + Handler: _Transactor_TransactAndHold_Handler, }, { MethodName: "Send", - Handler: _Transaction_Send_Handler, + Handler: _Transactor_Send_Handler, }, { MethodName: "SendAndHold", - Handler: _Transaction_SendAndHold_Handler, + Handler: _Transactor_SendAndHold_Handler, }, { MethodName: "SignTx", - Handler: _Transaction_SignTx_Handler, + Handler: _Transactor_SignTx_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "transaction.proto", -} - -func init() { proto.RegisterFile("transaction.proto", fileDescriptor_transaction_8daa2d775e90c023) } - -var fileDescriptor_transaction_8daa2d775e90c023 = []byte{ - // 470 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x55, 0x12, 0x93, 0x3a, 0xe3, 0x7c, 0xc0, 0x1e, 0x90, 0xb1, 0x10, 0x14, 0x23, 0x20, 0xa7, - 0x95, 0x1a, 0x4e, 0x5c, 0x90, 0xd2, 0x82, 0x00, 0x01, 0x52, 0xe5, 0x1a, 0x09, 0x71, 0x9b, 0x7a, - 0xb7, 0x95, 0xa5, 0x78, 0x37, 0x5a, 0x8f, 0x8b, 0x7f, 0x0d, 0xff, 0x85, 0x7f, 0x86, 0x76, 0x63, - 0xa7, 0x31, 0x21, 0x07, 0x7a, 0x9b, 0x8f, 0xa7, 0xf7, 0xde, 0x7a, 0x9e, 0xe1, 0x01, 0x19, 0x54, - 0x25, 0x66, 0x94, 0x6b, 0xc5, 0xd7, 0x46, 0x93, 0x8e, 0xc6, 0x99, 0x2e, 0x8a, 0xb6, 0x8b, 0xbf, - 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, 0xff, 0xff, 0xf0, 0x90, - 0x2d, 0xab, 0xfb, 0x03, 0x00, 0x00, + Metadata: "github.com/hyperledger/burrow/execution/pbtransactor/transactor.proto", +} + +func init() { + proto.RegisterFile("github.com/hyperledger/burrow/execution/pbtransactor/transactor.proto", fileDescriptor_transactor_abf3bfc7b34ac7c7) +} + +var fileDescriptor_transactor_abf3bfc7b34ac7c7 = []byte{ + // 614 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x51, 0x6f, 0xd3, 0x30, + 0x10, 0x56, 0xd7, 0xb0, 0xb5, 0xd7, 0x6e, 0x43, 0x96, 0x18, 0x59, 0x98, 0xd0, 0x94, 0xa7, 0x3e, + 0x35, 0x68, 0x20, 0x04, 0x42, 0x0c, 0xba, 0x6e, 0x6c, 0x68, 0x20, 0x4d, 0x59, 0x78, 0xe1, 0xcd, + 0x8d, 0x6f, 0x5d, 0xa4, 0x36, 0x8e, 0x1c, 0x67, 0xcb, 0x1e, 0x79, 0xe7, 0x9f, 0xf0, 0x27, 0x91, + 0x1d, 0xa7, 0x6d, 0x52, 0x0a, 0x0c, 0xf1, 0x94, 0xbb, 0xf3, 0xe7, 0xcf, 0xdf, 0xdd, 0xf9, 0x1c, + 0x38, 0x19, 0x47, 0xf2, 0x3a, 0x1b, 0xf5, 0x43, 0x3e, 0xf5, 0xae, 0xef, 0x12, 0x14, 0x13, 0x64, + 0x63, 0x14, 0xde, 0x28, 0x13, 0x82, 0xdf, 0x7a, 0x98, 0x63, 0x98, 0xc9, 0x88, 0xc7, 0x5e, 0x32, + 0x92, 0x82, 0xc6, 0x29, 0x0d, 0x25, 0x17, 0xde, 0xdc, 0xec, 0x27, 0x82, 0x4b, 0x4e, 0xba, 0x8b, + 0xcb, 0xce, 0xf1, 0xdf, 0x92, 0xe2, 0x0d, 0xc6, 0x32, 0xf5, 0x92, 0x91, 0x31, 0x8a, 0x4f,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, 0x4f, 0x96, + 0x51, 0xb3, 0x91, 0xff, 0x0d, 0xc5, 0x7b, 0x68, 0x95, 0xa9, 0xd4, 0x29, 0x2a, 0x73, 0xbe, 0x5a, + 0xff, 0x29, 0x6c, 0x97, 0xc8, 0x41, 0xcc, 0xce, 0xf8, 0x84, 0xfd, 0x99, 0xc8, 0xbc, 0x77, 0x27, + 0xea, 0x73, 0x4c, 0x25, 0xd5, 0x05, 0x78, 0x05, 0x96, 0x1a, 0xd6, 0x7a, 0x21, 0x66, 0x03, 0xbc, + 0x5a, 0xc2, 0x3b, 0xe8, 0x28, 0x54, 0x79, 0xfc, 0xfd, 0x09, 0xde, 0xc0, 0x7a, 0x31, 0x89, 0x64, + 0xb7, 0xb6, 0x77, 0x3e, 0x9f, 0xce, 0xce, 0xf2, 0x92, 0x9a, 0xa9, 0xa3, 0x97, 0x5f, 0x5f, 0xfc, + 0xcb, 0xcf, 0x64, 0xb4, 0xae, 0x9f, 0xfb, 0xe7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x16, + 0x56, 0xc5, 0x8b, 0x06, 0x00, 0x00, } diff --git a/rpc/burrow/transaction.proto b/execution/pbtransactor/transactor.proto similarity index 69% rename from rpc/burrow/transaction.proto rename to execution/pbtransactor/transactor.proto index a3d67ba734a0b324d4991c16a9142b2fbcd3d27a..07679018bbaf77bb7397d96283c68ca8db6e8260 100644 --- a/rpc/burrow/transaction.proto +++ b/execution/pbtransactor/transactor.proto @@ -1,16 +1,18 @@ syntax = 'proto3'; -option go_package = "burrow"; +package pbtransactor; -import "common.proto"; +option go_package = "github.com/hyperledger/burrow/execution/pbtransactor"; + +import "github.com/hyperledger/burrow/execution/events/pbevents/events.proto"; // Transaction Service Definition -service Transaction { +service Transactor { rpc BroadcastTx (TxParam) returns (TxReceipt); rpc Call (CallParam) returns (CallResult); rpc CallCode (CallCodeParam) returns (CallResult); rpc Transact (TransactParam) returns (TxReceipt); - rpc TransactAndHold (TransactParam) returns (EventDataCall); + rpc TransactAndHold (TransactParam) returns (pbevents.EventDataCall); rpc Send (SendParam) returns (TxReceipt); rpc SendAndHold (SendParam) returns (TxReceipt); rpc SignTx (SignTxParam) returns (SignedTx); @@ -62,4 +64,18 @@ message CallResult { uint64 GasUsed = 2; } +message TxReceipt { + bytes TxHash = 1; + bool CreatesContract = 2; + bytes ContractAddress = 3; +} + +message InputAccount { + bytes privateKey = 1; + bytes address = 2; +} + +message PrivateAccount { + bytes PrivateKey = 1; +} //-------------------------------------------------- \ No newline at end of file diff --git a/execution/transactor.go b/execution/transactor.go index 949dfb9c8653bd085e43b3fd944a6246fa390601..b620d481d6ddeabc034d76f0e8e4a14b1d8eb707 100644 --- a/execution/transactor.go +++ b/execution/transactor.go @@ -30,9 +30,8 @@ import ( "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/execution/errors" - exe_events "github.com/hyperledger/burrow/execution/events" + "github.com/hyperledger/burrow/execution/events" "github.com/hyperledger/burrow/execution/evm" - evm_events "github.com/hyperledger/burrow/execution/evm/events" "github.com/hyperledger/burrow/execution/executors" "github.com/hyperledger/burrow/logging" "github.com/hyperledger/burrow/logging/structure" @@ -211,7 +210,7 @@ func (trans *Transactor) Transact(sequentialSigningAccount *SequentialSigningAcc } func (trans *Transactor) TransactAndHold(ctx context.Context, sequentialSigningAccount *SequentialSigningAccount, - address *crypto.Address, data []byte, gasLimit, fee uint64) (*evm_events.EventDataCall, error) { + address *crypto.Address, data []byte, gasLimit, fee uint64) (*events.EventDataCall, error) { inputAccount, unlock, err := sequentialSigningAccount.Lock() if err != nil { @@ -233,9 +232,9 @@ func (trans *Transactor) TransactAndHold(ctx context.Context, sequentialSigningA // We want non-blocking on the first event received (but buffer the value), // after which we want to block (and then discard the value - see below) - ch := make(chan *evm_events.EventDataCall, 1) + ch := make(chan *events.EventDataCall, 1) - err = evm_events.SubscribeAccountCall(context.Background(), trans.eventEmitter, subID, expectedReceipt.ContractAddress, + err = events.SubscribeAccountCall(context.Background(), trans.eventEmitter, subID, expectedReceipt.ContractAddress, expectedReceipt.TxHash, 0, ch) if err != nil { return nil, err @@ -261,7 +260,7 @@ func (trans *Transactor) TransactAndHold(ctx context.Context, sequentialSigningA case <-timer.C: return nil, fmt.Errorf("transaction timed out TxHash: %X", expectedReceipt.TxHash) case eventDataCall := <-ch: - if eventDataCall.Exception != nil && eventDataCall.Exception.Code != errors.ErrorCodeExecutionReverted { + if eventDataCall.Exception != nil && eventDataCall.Exception.ErrorCode() != errors.ErrorCodeExecutionReverted { return nil, fmt.Errorf("error when transacting: %v", eventDataCall.Exception) } else { return eventDataCall, nil @@ -331,7 +330,7 @@ func (trans *Transactor) SendAndHold(ctx context.Context, sequentialSigningAccou } wc := make(chan *payload.SendTx) - err = exe_events.SubscribeAccountOutputSendTx(context.Background(), trans.eventEmitter, subID, toAddress, + err = events.SubscribeAccountOutputSendTx(context.Background(), trans.eventEmitter, subID, toAddress, expectedReceipt.TxHash, wc) if err != nil { return nil, err diff --git a/rpc/burrow/account.pb.go b/rpc/burrow/account.pb.go index 48e4232dece61b9fc80969b7c4bd17273da053c2..18771ad43e8143c139272e2ace8d3801e775ebb6 100644 --- a/rpc/burrow/account.pb.go +++ b/rpc/burrow/account.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: account.proto +// source: rpc/burrow/account.proto package burrow @@ -35,7 +35,7 @@ func (m *AddressParam) Reset() { *m = AddressParam{} } func (m *AddressParam) String() string { return proto.CompactTextString(m) } func (*AddressParam) ProtoMessage() {} func (*AddressParam) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{0} + return fileDescriptor_account_ff00efb2ede9d492, []int{0} } func (m *AddressParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressParam.Unmarshal(m, b) @@ -73,7 +73,7 @@ func (m *PrivateKeyParam) Reset() { *m = PrivateKeyParam{} } func (m *PrivateKeyParam) String() string { return proto.CompactTextString(m) } func (*PrivateKeyParam) ProtoMessage() {} func (*PrivateKeyParam) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{1} + return fileDescriptor_account_ff00efb2ede9d492, []int{1} } func (m *PrivateKeyParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PrivateKeyParam.Unmarshal(m, b) @@ -112,7 +112,7 @@ func (m *StorageAtParam) Reset() { *m = StorageAtParam{} } func (m *StorageAtParam) String() string { return proto.CompactTextString(m) } func (*StorageAtParam) ProtoMessage() {} func (*StorageAtParam) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{2} + return fileDescriptor_account_ff00efb2ede9d492, []int{2} } func (m *StorageAtParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StorageAtParam.Unmarshal(m, b) @@ -158,7 +158,7 @@ func (m *BasePermissions) Reset() { *m = BasePermissions{} } func (m *BasePermissions) String() string { return proto.CompactTextString(m) } func (*BasePermissions) ProtoMessage() {} func (*BasePermissions) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{3} + return fileDescriptor_account_ff00efb2ede9d492, []int{3} } func (m *BasePermissions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BasePermissions.Unmarshal(m, b) @@ -204,7 +204,7 @@ func (m *AccountPermissions) Reset() { *m = AccountPermissions{} } func (m *AccountPermissions) String() string { return proto.CompactTextString(m) } func (*AccountPermissions) ProtoMessage() {} func (*AccountPermissions) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{4} + return fileDescriptor_account_ff00efb2ede9d492, []int{4} } func (m *AccountPermissions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountPermissions.Unmarshal(m, b) @@ -255,7 +255,7 @@ func (m *Account) Reset() { *m = Account{} } func (m *Account) String() string { return proto.CompactTextString(m) } func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{5} + return fileDescriptor_account_ff00efb2ede9d492, []int{5} } func (m *Account) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Account.Unmarshal(m, b) @@ -336,7 +336,7 @@ func (m *AccountList) Reset() { *m = AccountList{} } func (m *AccountList) String() string { return proto.CompactTextString(m) } func (*AccountList) ProtoMessage() {} func (*AccountList) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{6} + return fileDescriptor_account_ff00efb2ede9d492, []int{6} } func (m *AccountList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountList.Unmarshal(m, b) @@ -383,7 +383,7 @@ func (m *Validator) Reset() { *m = Validator{} } func (m *Validator) String() string { return proto.CompactTextString(m) } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{7} + return fileDescriptor_account_ff00efb2ede9d492, []int{7} } func (m *Validator) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Validator.Unmarshal(m, b) @@ -437,7 +437,7 @@ func (m *ValidatorList) Reset() { *m = ValidatorList{} } func (m *ValidatorList) String() string { return proto.CompactTextString(m) } func (*ValidatorList) ProtoMessage() {} func (*ValidatorList) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{8} + return fileDescriptor_account_ff00efb2ede9d492, []int{8} } func (m *ValidatorList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ValidatorList.Unmarshal(m, b) @@ -490,7 +490,7 @@ func (m *StorageItem) Reset() { *m = StorageItem{} } func (m *StorageItem) String() string { return proto.CompactTextString(m) } func (*StorageItem) ProtoMessage() {} func (*StorageItem) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{9} + return fileDescriptor_account_ff00efb2ede9d492, []int{9} } func (m *StorageItem) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StorageItem.Unmarshal(m, b) @@ -536,7 +536,7 @@ func (m *StorageDump) Reset() { *m = StorageDump{} } func (m *StorageDump) String() string { return proto.CompactTextString(m) } func (*StorageDump) ProtoMessage() {} func (*StorageDump) Descriptor() ([]byte, []int) { - return fileDescriptor_account_86ce8fb810bd0a0b, []int{10} + return fileDescriptor_account_ff00efb2ede9d492, []int{10} } func (m *StorageDump) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StorageDump.Unmarshal(m, b) @@ -851,49 +851,50 @@ var _Accounts_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "account.proto", -} - -func init() { proto.RegisterFile("account.proto", fileDescriptor_account_86ce8fb810bd0a0b) } - -var fileDescriptor_account_86ce8fb810bd0a0b = []byte{ - // 602 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x56, 0x9a, 0x34, 0x4d, 0xc7, 0xce, 0x8f, 0xb6, 0x80, 0xac, 0x08, 0xa1, 0xc8, 0x2a, 0x22, - 0x3d, 0x74, 0x05, 0x41, 0xe5, 0x80, 0x2a, 0xa1, 0x18, 0x68, 0x40, 0xe5, 0x10, 0x39, 0x6a, 0x25, - 0xb8, 0x6d, 0xec, 0x55, 0xb0, 0x6a, 0x7b, 0x83, 0xbd, 0xa6, 0xca, 0x13, 0xf1, 0x2e, 0x3c, 0x07, - 0x0f, 0x82, 0x76, 0xbd, 0xde, 0xac, 0x13, 0x24, 0x10, 0x37, 0x7f, 0x33, 0xdf, 0xcc, 0xec, 0x7c, - 0x33, 0x1e, 0xe8, 0x92, 0x20, 0x60, 0x45, 0xca, 0xf1, 0x3a, 0x63, 0x9c, 0x0d, 0xed, 0x80, 0x25, - 0x09, 0x4b, 0x4b, 0xe4, 0x8e, 0xc1, 0x9e, 0x86, 0x61, 0x46, 0xf3, 0x7c, 0x4e, 0x32, 0x92, 0x20, - 0x07, 0x8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f8, 0x6a, 0xdf, 0xdb, - 0xf8, 0x7d, 0xb2, 0xe6, 0x9b, 0x61, 0x1f, 0xab, 0x33, 0x50, 0x39, 0x5e, 0xc3, 0xc3, 0x3a, 0xf5, - 0x2a, 0x63, 0x89, 0xe8, 0x64, 0x80, 0x77, 0x0e, 0xc6, 0x7e, 0xec, 0x53, 0x80, 0x19, 0xe5, 0x15, - 0xea, 0x62, 0xf3, 0x16, 0x0d, 0xf5, 0x0e, 0xa1, 0x73, 0xb0, 0xb6, 0xb4, 0x1c, 0x0d, 0xf0, 0x55, - 0x14, 0x73, 0x2a, 0x07, 0x5d, 0x52, 0x6d, 0x6c, 0x2e, 0xec, 0x33, 0xe8, 0xce, 0x28, 0x37, 0x46, - 0x56, 0xbd, 0xbd, 0x87, 0xeb, 0x4b, 0x72, 0x26, 0xcb, 0x2b, 0x15, 0x76, 0xcb, 0x6b, 0xad, 0xa4, - 0xe2, 0xe7, 0x60, 0x6f, 0xa9, 0x53, 0x8e, 0xfa, 0xb8, 0x7e, 0xda, 0x86, 0x35, 0x69, 0xbd, 0xce, - 0x97, 0xf6, 0xb2, 0xc8, 0x32, 0x76, 0xbf, 0x6c, 0xcb, 0x43, 0xfb, 0xf2, 0x77, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xb8, 0xc0, 0x82, 0xf8, 0x87, 0x05, 0x00, 0x00, + Metadata: "rpc/burrow/account.proto", +} + +func init() { proto.RegisterFile("rpc/burrow/account.proto", fileDescriptor_account_ff00efb2ede9d492) } + +var fileDescriptor_account_ff00efb2ede9d492 = []byte{ + // 612 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xdd, 0x6e, 0xd3, 0x4c, + 0x10, 0x55, 0x9a, 0x34, 0x4d, 0xc7, 0x6e, 0x13, 0x6d, 0xbf, 0x0f, 0xac, 0x08, 0xa1, 0xca, 0x2a, + 0xa2, 0xbd, 0xe8, 0x16, 0x8a, 0xca, 0x05, 0xaa, 0x84, 0x62, 0xa0, 0x01, 0x95, 0x8b, 0xc8, 0x51, + 0x2b, 0xc1, 0xdd, 0xc6, 0x5e, 0x05, 0xab, 0xb6, 0x37, 0xac, 0xd7, 0x54, 0x79, 0x22, 0xde, 0x85, + 0xe7, 0xe0, 0x41, 0xd0, 0xfe, 0xd8, 0x59, 0x27, 0x48, 0x20, 0xee, 0x7c, 0x66, 0xce, 0xcc, 0xec, + 0x9c, 0x19, 0x0f, 0x78, 0x7c, 0x11, 0x9d, 0xcd, 0x4a, 0xce, 0xd9, 0xfd, 0x19, 0x89, 0x22, 0x56, + 0xe6, 0x02, 0x2f, 0x38, 0x13, 0x6c, 0xf8, 0xd0, 0xf2, 0x44, 0x2c, 0xcb, 0x58, 0xae, 0x1d, 0xfe, + 0x31, 0xb8, 0xa3, 0x38, 0xe6, 0xb4, 0x28, 0x26, 0x84, 0x93, 0x0c, 0x79, 0xb0, 0x43, 0x34, 0xf6, + 0x5a, 0x87, 0xad, 0x63, 0x37, 0xac, 0xa0, 0xff, 0x1c, 0xfa, 0x13, 0x9e, 0x7c, 0x23, 0x82, 0x5e, + 0xd3, 0xa5, 0x26, 0x3f, 0x06, 0x58, 0xd4, 0x26, 0xc3, 0xb7, 0x2c, 0xfe, 0x25, 0xec, 0x4f, 0x05, + 0xe3, 0x64, 0x4e, 0x47, 0xe2, 0x0f, 0xe9, 0xd1, 0x00, 0xda, 0x77, 0x74, 0xe9, 0x6d, 0x29, 0xab, + 0xfc, 0xf4, 0x5f, 0x43, 0x3f, 0x20, 0x05, 0x9d, 0x50, 0x9e, 0x25, 0x45, 0x91, 0xb0, 0xbc, 0x40, + 0xff, 0xc1, 0xb6, 0x84, 0x3a, 0xb8, 0x13, 0x6a, 0x80, 0x1e, 0x40, 0x77, 0x4a, 0x45, 0x90, 0x08, + 0x15, 0xdd, 0x09, 0x0d, 0xf2, 0x27, 0x80, 0x46, 0x5a, 0x05, 0x3b, 0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 0x61, 0x43, 0xda, 0xa0, 0xf7, 0xb9, 0xab, 0xcf, + 0xed, 0xac, 0xab, 0x0e, 0xed, 0x8b, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xd4, 0xb8, 0x59, + 0x9d, 0x05, 0x00, 0x00, } diff --git a/rpc/burrow/account.proto b/rpc/burrow/account.proto index abdb6e1c010641a14d9369ab088e780b7052a5f5..72d4bb459e14367876b66041a4c961b1393b3558 100644 --- a/rpc/burrow/account.proto +++ b/rpc/burrow/account.proto @@ -2,7 +2,7 @@ syntax = 'proto3'; option go_package = "burrow"; -import "common.proto"; +import "rpc/burrow/common.proto"; // Account Service definition service Accounts { diff --git a/rpc/burrow/blockchain.pb.go b/rpc/burrow/blockchain.pb.go index 697b048828369e1ecae9cace5ed692d60220a768..5f4e526da9c53a31a30beb34ade80bfd2dbc3779 100644 --- a/rpc/burrow/blockchain.pb.go +++ b/rpc/burrow/blockchain.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: blockchain.proto +// source: rpc/burrow/blockchain.proto package burrow @@ -35,7 +35,7 @@ func (m *HeightParam) Reset() { *m = HeightParam{} } func (m *HeightParam) String() string { return proto.CompactTextString(m) } func (*HeightParam) ProtoMessage() {} func (*HeightParam) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{0} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{0} } func (m *HeightParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HeightParam.Unmarshal(m, b) @@ -74,7 +74,7 @@ func (m *BlocksParam) Reset() { *m = BlocksParam{} } func (m *BlocksParam) String() string { return proto.CompactTextString(m) } func (*BlocksParam) ProtoMessage() {} func (*BlocksParam) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{1} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{1} } func (m *BlocksParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlocksParam.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{2} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{2} } func (m *Header) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Header.Unmarshal(m, b) @@ -223,7 +223,7 @@ func (m *Data) Reset() { *m = Data{} } func (m *Data) String() string { return proto.CompactTextString(m) } func (*Data) ProtoMessage() {} func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{3} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{3} } func (m *Data) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Data.Unmarshal(m, b) @@ -270,7 +270,7 @@ func (m *Block) Reset() { *m = Block{} } func (m *Block) String() string { return proto.CompactTextString(m) } func (*Block) ProtoMessage() {} func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{4} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{4} } func (m *Block) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Block.Unmarshal(m, b) @@ -323,7 +323,7 @@ func (m *BlockMeta) Reset() { *m = BlockMeta{} } func (m *BlockMeta) String() string { return proto.CompactTextString(m) } func (*BlockMeta) ProtoMessage() {} func (*BlockMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{5} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{5} } func (m *BlockMeta) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockMeta.Unmarshal(m, b) @@ -369,7 +369,7 @@ func (m *BlockList) Reset() { *m = BlockList{} } func (m *BlockList) String() string { return proto.CompactTextString(m) } func (*BlockList) ProtoMessage() {} func (*BlockList) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{6} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{6} } func (m *BlockList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockList.Unmarshal(m, b) @@ -416,7 +416,7 @@ func (m *ChainId) Reset() { *m = ChainId{} } func (m *ChainId) String() string { return proto.CompactTextString(m) } func (*ChainId) ProtoMessage() {} func (*ChainId) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{7} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{7} } func (m *ChainId) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ChainId.Unmarshal(m, b) @@ -473,7 +473,7 @@ func (m *GenesisDoc) Reset() { *m = GenesisDoc{} } func (m *GenesisDoc) String() string { return proto.CompactTextString(m) } func (*GenesisDoc) ProtoMessage() {} func (*GenesisDoc) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{8} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{8} } func (m *GenesisDoc) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GenesisDoc.Unmarshal(m, b) @@ -550,7 +550,7 @@ func (m *GenesisDoc_GenesisAccount) Reset() { *m = GenesisDoc_GenesisAcc func (m *GenesisDoc_GenesisAccount) String() string { return proto.CompactTextString(m) } func (*GenesisDoc_GenesisAccount) ProtoMessage() {} func (*GenesisDoc_GenesisAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{8, 0} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{8, 0} } func (m *GenesisDoc_GenesisAccount) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GenesisDoc_GenesisAccount.Unmarshal(m, b) @@ -620,7 +620,7 @@ func (m *GenesisDoc_GenesisValidator) Reset() { *m = GenesisDoc_GenesisV func (m *GenesisDoc_GenesisValidator) String() string { return proto.CompactTextString(m) } func (*GenesisDoc_GenesisValidator) ProtoMessage() {} func (*GenesisDoc_GenesisValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{8, 1} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{8, 1} } func (m *GenesisDoc_GenesisValidator) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GenesisDoc_GenesisValidator.Unmarshal(m, b) @@ -687,7 +687,7 @@ func (m *UnconfirmedTxList) Reset() { *m = UnconfirmedTxList{} } func (m *UnconfirmedTxList) String() string { return proto.CompactTextString(m) } func (*UnconfirmedTxList) ProtoMessage() {} func (*UnconfirmedTxList) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{9} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{9} } func (m *UnconfirmedTxList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnconfirmedTxList.Unmarshal(m, b) @@ -738,7 +738,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{10} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{10} } func (m *Status) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Status.Unmarshal(m, b) @@ -824,7 +824,7 @@ func (m *RoundState) Reset() { *m = RoundState{} } func (m *RoundState) String() string { return proto.CompactTextString(m) } func (*RoundState) ProtoMessage() {} func (*RoundState) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{11} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{11} } func (m *RoundState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RoundState.Unmarshal(m, b) @@ -894,7 +894,7 @@ func (m *PeerRoundState) Reset() { *m = PeerRoundState{} } func (m *PeerRoundState) String() string { return proto.CompactTextString(m) } func (*PeerRoundState) ProtoMessage() {} func (*PeerRoundState) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{12} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{12} } func (m *PeerRoundState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PeerRoundState.Unmarshal(m, b) @@ -961,7 +961,7 @@ func (m *ConsensusState) Reset() { *m = ConsensusState{} } func (m *ConsensusState) String() string { return proto.CompactTextString(m) } func (*ConsensusState) ProtoMessage() {} func (*ConsensusState) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_7e3899cdd33a3484, []int{13} + return fileDescriptor_blockchain_8510b9aa600a1d3c, []int{13} } func (m *ConsensusState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConsensusState.Unmarshal(m, b) @@ -1314,72 +1314,74 @@ var _Blockchain_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "blockchain.proto", -} - -func init() { proto.RegisterFile("blockchain.proto", fileDescriptor_blockchain_7e3899cdd33a3484) } - -var fileDescriptor_blockchain_7e3899cdd33a3484 = []byte{ - // 962 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x51, 0x6f, 0xe3, 0x44, - 0x10, 0x56, 0x12, 0xc7, 0x75, 0xc6, 0x21, 0x6d, 0x17, 0x84, 0x82, 0x75, 0x3a, 0x82, 0x45, 0x51, - 0x04, 0x95, 0x91, 0x82, 0x40, 0x42, 0x82, 0x87, 0x5e, 0x0b, 0x6d, 0x45, 0xa9, 0xa2, 0x6d, 0xef, - 0x90, 0x90, 0x78, 0xd8, 0xc4, 0x7b, 0xc4, 0xba, 0xd8, 0x1b, 0xd9, 0x1b, 0x5d, 0xef, 0x3f, 0x20, - 0x1e, 0xe0, 0x67, 0xf0, 0x23, 0x78, 0xe4, 0x6f, 0xa1, 0x9d, 0xdd, 0xb5, 0xd7, 0x2e, 0x6f, 0x48, - 0xf7, 0xb6, 0xf3,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0xbf, 0x86, 0xc3, 0x76, - 0x31, 0x76, 0x23, 0x1f, 0x26, 0x6d, 0x9c, 0x76, 0x79, 0x8b, 0xbf, 0xfb, 0x66, 0x91, 0xe3, 0xdf, - 0x08, 0x99, 0x41, 0x70, 0xc9, 0xf5, 0x8b, 0x25, 0xe3, 0xc4, 0xf9, 0xcd, 0x88, 0x7c, 0xbd, 0xdc, - 0xc9, 0x09, 0x8c, 0x2c, 0xa3, 0x22, 0xe3, 0xc4, 0xf9, 0xc5, 0x88, 0xcc, 0xfe, 0xc7, 0x79, 0xf9, - 0x18, 0x8e, 0x2d, 0x0d, 0x23, 0xa3, 0xd0, 0xfd, 0xe4, 0xbb, 0x7c, 0x27, 0xdf, 0x44, 0x07, 0x89, - 0x19, 0x90, 0xa7, 0x6a, 0x67, 0x4b, 0xbb, 0xe4, 0xad, 0x3b, 0x48, 0x2c, 0xf2, 0x11, 0xfa, 0xcd, - 0x24, 0xd4, 0xfe, 0x30, 0x69, 0x2d, 0xfa, 0xc9, 0x25, 0x97, 0x8e, 0x20, 0x6b, 0x9a, 0xcd, 0xf8, - 0x73, 0x4c, 0xa5, 0x35, 0xd2, 0x4d, 0x2c, 0x92, 0x3c, 0x9e, 0xf5, 0x53, 0xbc, 0xd0, 0x79, 0x21, - 0xf6, 0xc2, 0x61, 0xd2, 0x76, 0x3c, 0x0b, 0x7e, 0xf6, 0x57, 0xfb, 0xb2, 0x14, 0xaf, 0x57, 0x3e, - 0xfe, 0x9f, 0x7d, 0xf1, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x7b, 0x1e, 0x43, 0xdf, 0x09, - 0x00, 0x00, + Metadata: "rpc/burrow/blockchain.proto", +} + +func init() { + proto.RegisterFile("rpc/burrow/blockchain.proto", fileDescriptor_blockchain_8510b9aa600a1d3c) +} + +var fileDescriptor_blockchain_8510b9aa600a1d3c = []byte{ + // 974 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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xf6, 0x16, 0xfd, 0xce, 0x39, 0x97, 0x8e, 0x20, 0x5b, 0x9a, 0xcd, 0xf8, 0x08, + 0x53, 0xe9, 0x8d, 0x74, 0x17, 0x8b, 0xa4, 0x0f, 0x67, 0xfd, 0x10, 0x2f, 0x0c, 0x5e, 0x88, 0xbd, + 0xb0, 0x9b, 0xf6, 0x1d, 0x4f, 0x83, 0x5f, 0x7d, 0xfd, 0x9b, 0xb6, 0xf0, 0xf1, 0xff, 0xec, 0xab, + 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x42, 0x0e, 0xfe, 0x43, 0x0b, 0x0a, 0x00, 0x00, } diff --git a/rpc/burrow/blockchain.proto b/rpc/burrow/blockchain.proto index 8b1462f0ca8b288721905e4ba3971038dfa361f5..95da46b43a2a11c3806e3c79c5d3f9105158441c 100644 --- a/rpc/burrow/blockchain.proto +++ b/rpc/burrow/blockchain.proto @@ -2,9 +2,9 @@ syntax = 'proto3'; option go_package = "burrow"; -import "common.proto"; -import "account.proto"; -import "network.proto"; +import "rpc/burrow/common.proto"; +import "rpc/burrow/account.proto"; +import "rpc/burrow/network.proto"; // Blockchain Service Definition service Blockchain { diff --git a/rpc/burrow/common.pb.go b/rpc/burrow/common.pb.go index 8fb69ed5e13d9994edb2add59aabbf4cd76bb615..f866428e140ff5f3c2c2acb9985ab95ecf2b1299 100644 --- a/rpc/burrow/common.pb.go +++ b/rpc/burrow/common.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: common.proto +// source: rpc/burrow/common.proto package burrow @@ -29,7 +29,7 @@ func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{0} + return fileDescriptor_common_5e5d896650e7b950, []int{0} } func (m *Empty) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Empty.Unmarshal(m, b) @@ -61,7 +61,7 @@ func (m *InputAccount) Reset() { *m = InputAccount{} } func (m *InputAccount) String() string { return proto.CompactTextString(m) } func (*InputAccount) ProtoMessage() {} func (*InputAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{1} + return fileDescriptor_common_5e5d896650e7b950, []int{1} } func (m *InputAccount) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InputAccount.Unmarshal(m, b) @@ -108,7 +108,7 @@ func (m *FilterData) Reset() { *m = FilterData{} } func (m *FilterData) String() string { return proto.CompactTextString(m) } func (*FilterData) ProtoMessage() {} func (*FilterData) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{2} + return fileDescriptor_common_5e5d896650e7b950, []int{2} } func (m *FilterData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FilterData.Unmarshal(m, b) @@ -160,7 +160,7 @@ func (m *FilterListParam) Reset() { *m = FilterListParam{} } func (m *FilterListParam) String() string { return proto.CompactTextString(m) } func (*FilterListParam) ProtoMessage() {} func (*FilterListParam) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{3} + return fileDescriptor_common_5e5d896650e7b950, []int{3} } func (m *FilterListParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FilterListParam.Unmarshal(m, b) @@ -202,7 +202,7 @@ func (m *TxReceipt) Reset() { *m = TxReceipt{} } func (m *TxReceipt) String() string { return proto.CompactTextString(m) } func (*TxReceipt) ProtoMessage() {} func (*TxReceipt) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{4} + return fileDescriptor_common_5e5d896650e7b950, []int{4} } func (m *TxReceipt) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TxReceipt.Unmarshal(m, b) @@ -256,7 +256,7 @@ func (m *PrivateAccount) Reset() { *m = PrivateAccount{} } func (m *PrivateAccount) String() string { return proto.CompactTextString(m) } func (*PrivateAccount) ProtoMessage() {} func (*PrivateAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{5} + return fileDescriptor_common_5e5d896650e7b950, []int{5} } func (m *PrivateAccount) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PrivateAccount.Unmarshal(m, b) @@ -283,156 +283,6 @@ func (m *PrivateAccount) GetPrivateKey() []byte { return nil } -// This is hear because it is used by both the Events service (Poll) and the -// Transaction service (TransactAndHold) -type EventDataCall struct { - CallData *CallData `protobuf:"bytes,1,opt,name=CallData,proto3" json:"CallData,omitempty"` - Origin []byte `protobuf:"bytes,2,opt,name=Origin,proto3" json:"Origin,omitempty"` - TxHash []byte `protobuf:"bytes,3,opt,name=TxHash,proto3" json:"TxHash,omitempty"` - StackDepth int64 `protobuf:"varint,4,opt,name=StackDepth,proto3" json:"StackDepth,omitempty"` - Return []byte `protobuf:"bytes,5,opt,name=Return,proto3" json:"Return,omitempty"` - Exception string `protobuf:"bytes,6,opt,name=Exception,proto3" json:"Exception,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataCall) Reset() { *m = EventDataCall{} } -func (m *EventDataCall) String() string { return proto.CompactTextString(m) } -func (*EventDataCall) ProtoMessage() {} -func (*EventDataCall) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{6} -} -func (m *EventDataCall) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataCall.Unmarshal(m, b) -} -func (m *EventDataCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataCall.Marshal(b, m, deterministic) -} -func (dst *EventDataCall) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataCall.Merge(dst, src) -} -func (m *EventDataCall) XXX_Size() int { - return xxx_messageInfo_EventDataCall.Size(m) -} -func (m *EventDataCall) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataCall.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataCall proto.InternalMessageInfo - -func (m *EventDataCall) GetCallData() *CallData { - if m != nil { - return m.CallData - } - return nil -} - -func (m *EventDataCall) GetOrigin() []byte { - if m != nil { - return m.Origin - } - return nil -} - -func (m *EventDataCall) GetTxHash() []byte { - if m != nil { - return m.TxHash - } - return nil -} - -func (m *EventDataCall) GetStackDepth() int64 { - if m != nil { - return m.StackDepth - } - return 0 -} - -func (m *EventDataCall) GetReturn() []byte { - if m != nil { - return m.Return - } - return nil -} - -func (m *EventDataCall) GetException() string { - if m != nil { - return m.Exception - } - return "" -} - -type CallData struct { - Caller []byte `protobuf:"bytes,1,opt,name=Caller,proto3" json:"Caller,omitempty"` - Callee []byte `protobuf:"bytes,2,opt,name=Callee,proto3" json:"Callee,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` - Value uint64 `protobuf:"varint,4,opt,name=Value,proto3" json:"Value,omitempty"` - Gas uint64 `protobuf:"varint,5,opt,name=Gas,proto3" json:"Gas,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CallData) Reset() { *m = CallData{} } -func (m *CallData) String() string { return proto.CompactTextString(m) } -func (*CallData) ProtoMessage() {} -func (*CallData) Descriptor() ([]byte, []int) { - return fileDescriptor_common_7756ad6b090c8499, []int{7} -} -func (m *CallData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CallData.Unmarshal(m, b) -} -func (m *CallData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CallData.Marshal(b, m, deterministic) -} -func (dst *CallData) XXX_Merge(src proto.Message) { - xxx_messageInfo_CallData.Merge(dst, src) -} -func (m *CallData) XXX_Size() int { - return xxx_messageInfo_CallData.Size(m) -} -func (m *CallData) XXX_DiscardUnknown() { - xxx_messageInfo_CallData.DiscardUnknown(m) -} - -var xxx_messageInfo_CallData proto.InternalMessageInfo - -func (m *CallData) GetCaller() []byte { - if m != nil { - return m.Caller - } - return nil -} - -func (m *CallData) GetCallee() []byte { - if m != nil { - return m.Callee - } - return nil -} - -func (m *CallData) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *CallData) GetValue() uint64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *CallData) GetGas() uint64 { - if m != nil { - return m.Gas - } - return 0 -} - func init() { proto.RegisterType((*Empty)(nil), "Empty") proto.RegisterType((*InputAccount)(nil), "InputAccount") @@ -440,38 +290,28 @@ func init() { proto.RegisterType((*FilterListParam)(nil), "FilterListParam") proto.RegisterType((*TxReceipt)(nil), "TxReceipt") proto.RegisterType((*PrivateAccount)(nil), "PrivateAccount") - proto.RegisterType((*EventDataCall)(nil), "EventDataCall") - proto.RegisterType((*CallData)(nil), "CallData") -} - -func init() { proto.RegisterFile("common.proto", fileDescriptor_common_7756ad6b090c8499) } - -var fileDescriptor_common_7756ad6b090c8499 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x52, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x95, 0x63, 0xe7, 0xc3, 0x93, 0xd0, 0xa2, 0x15, 0x42, 0x3e, 0xa0, 0x2a, 0x5a, 0xa9, 0x52, - 0x4e, 0x11, 0x2a, 0x17, 0xae, 0x25, 0x0d, 0x04, 0x81, 0x44, 0xb4, 0x54, 0x1c, 0xb8, 0x6d, 0x9d, - 0x29, 0x5d, 0xe1, 0xec, 0xae, 0xd6, 0xe3, 0x34, 0xfd, 0x6f, 0xfc, 0x38, 0xb4, 0xbb, 0x76, 0x93, - 0xb6, 0x27, 0xcf, 0x7b, 0xf3, 0xe1, 0xf7, 0x66, 0x07, 0x26, 0xa5, 0xd9, 0x6e, 0x8d, 0x9e, 0x5b, - 0x67, 0xc8, 0xf0, 0x21, 0xf4, 0x97, 0x5b, 0x4b, 0x0f, 0x7c, 0x05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0xd8, 0x39, 0x8c, 0xfc, 0xd7, 0xe3, 0x50, 0x3f, 0xbe, 0xc8, 0xe7, 0x1d, 0x21, 0x1e, 0x53, - 0xde, 0xd6, 0x0f, 0xa7, 0xfe, 0x28, 0xdd, 0x3e, 0x40, 0x8b, 0x8e, 0xec, 0xa6, 0x4f, 0xec, 0x9e, - 0x01, 0xfc, 0x24, 0x59, 0xfe, 0xbd, 0x42, 0x4b, 0x77, 0x45, 0x36, 0x4d, 0x66, 0xa9, 0x38, 0x62, - 0x7c, 0x9f, 0x40, 0x6a, 0x9c, 0x2e, 0xfa, 0xb1, 0x2f, 0x22, 0xf6, 0x0e, 0xf2, 0xe5, 0xbe, 0x44, - 0x4b, 0xca, 0xe8, 0x62, 0x10, 0xde, 0xe7, 0x40, 0xf0, 0x1d, 0x3c, 0x51, 0xe4, 0x63, 0x74, 0xdd, - 0xa2, 0x23, 0x7a, 0xe4, 0xb1, 0x53, 0x1a, 0x11, 0x63, 0x90, 0x05, 0x93, 0x51, 0x67, 0xd6, 0xdd, - 0xcb, 0xaf, 0x70, 0x09, 0x5e, 0x60, 0x26, 0x22, 0x60, 0xaf, 0x21, 0xfd, 0x22, 0xeb, 0x20, 0x2c, - 0x13, 0x3e, 0xfc, 0x34, 0xfa, 0x3d, 0xb8, 0x69, 0x9c, 0x33, 0xf7, 0x37, 0x83, 0x70, 0xc9, 0x1f, - 0xfe, 0x07, 0x00, 0x00, 0xff, 0xff, 0x01, 0xe3, 0x1a, 0x5e, 0xd9, 0x02, 0x00, 0x00, +} + +func init() { proto.RegisterFile("rpc/burrow/common.proto", fileDescriptor_common_5e5d896650e7b950) } + +var fileDescriptor_common_5e5d896650e7b950 = []byte{ + // 284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xbf, 0x6b, 0xfb, 0x30, + 0x10, 0xc5, 0xb1, 0x4d, 0xec, 0xf8, 0x12, 0x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, 0x59, 0x6a, + 0x24, 0xff, 0x21, 0x5c, 0x1f, 0x32, 0x6e, 0xbf, 0xfb, 0x31, 0x7a, 0x45, 0x52, 0x98, 0xae, 0x8c, + 0xe4, 0x28, 0xed, 0x4a, 0x35, 0x68, 0xb8, 0x40, 0xf7, 0xa3, 0x21, 0xbb, 0xc6, 0xae, 0xb3, 0x3f, + 0x2f, 0xfb, 0xa1, 0x03, 0x67, 0x75, 0x8d, 0xe9, 0x3d, 0x4c, 0xf2, 0x2e, 0xa4, 0x8b, 0x20, 0xf3, + 0x3f, 0x41, 0x9e, 0xc9, 0xf3, 0xf0, 0x2b, 0xec, 0x16, 0xb3, 0x09, 0xdd, 0x4a, 0x1e, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x98, 0x63, 0x0b, 0xe0, 0xad, 0x01, 0x00, 0x00, } diff --git a/rpc/burrow/common.proto b/rpc/burrow/common.proto index c0bbd60512a40bf030a859de5c89098d71d756b0..ac54e03261afb733445f573b908bed35e950ce0c 100644 --- a/rpc/burrow/common.proto +++ b/rpc/burrow/common.proto @@ -36,22 +36,3 @@ message PrivateAccount { bytes PrivateKey = 1; } -// This is hear because it is used by both the Events service (Poll) and the -// Transaction service (TransactAndHold) -message EventDataCall { - CallData CallData = 1; - bytes Origin = 2; - bytes TxHash = 3; - int64 StackDepth = 4; - bytes Return = 5; - string Exception = 6; -} - -message CallData { - bytes Caller = 1; - bytes Callee = 2; - bytes Data = 3; - uint64 Value = 4; - uint64 Gas = 5; -} - diff --git a/rpc/burrow/event.pb.go b/rpc/burrow/event.pb.go deleted file mode 100644 index 1e49e01e7035a0c836efbc4d4abaf539e201f6c9..0000000000000000000000000000000000000000 --- a/rpc/burrow/event.pb.go +++ /dev/null @@ -1,535 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: event.proto - -package burrow - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// Params -type EventIdParam struct { - EventId string `protobuf:"bytes,1,opt,name=eventId,proto3" json:"eventId,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventIdParam) Reset() { *m = EventIdParam{} } -func (m *EventIdParam) String() string { return proto.CompactTextString(m) } -func (*EventIdParam) ProtoMessage() {} -func (*EventIdParam) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{0} -} -func (m *EventIdParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventIdParam.Unmarshal(m, b) -} -func (m *EventIdParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventIdParam.Marshal(b, m, deterministic) -} -func (dst *EventIdParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventIdParam.Merge(dst, src) -} -func (m *EventIdParam) XXX_Size() int { - return xxx_messageInfo_EventIdParam.Size(m) -} -func (m *EventIdParam) XXX_DiscardUnknown() { - xxx_messageInfo_EventIdParam.DiscardUnknown(m) -} - -var xxx_messageInfo_EventIdParam proto.InternalMessageInfo - -func (m *EventIdParam) GetEventId() string { - if m != nil { - return m.EventId - } - return "" -} - -type SubIdParam struct { - SubId string `protobuf:"bytes,1,opt,name=subId,proto3" json:"subId,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubIdParam) Reset() { *m = SubIdParam{} } -func (m *SubIdParam) String() string { return proto.CompactTextString(m) } -func (*SubIdParam) ProtoMessage() {} -func (*SubIdParam) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{1} -} -func (m *SubIdParam) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubIdParam.Unmarshal(m, b) -} -func (m *SubIdParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubIdParam.Marshal(b, m, deterministic) -} -func (dst *SubIdParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubIdParam.Merge(dst, src) -} -func (m *SubIdParam) XXX_Size() int { - return xxx_messageInfo_SubIdParam.Size(m) -} -func (m *SubIdParam) XXX_DiscardUnknown() { - xxx_messageInfo_SubIdParam.DiscardUnknown(m) -} - -var xxx_messageInfo_SubIdParam proto.InternalMessageInfo - -func (m *SubIdParam) GetSubId() string { - if m != nil { - return m.SubId - } - return "" -} - -// Results -type EventUnSub struct { - Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventUnSub) Reset() { *m = EventUnSub{} } -func (m *EventUnSub) String() string { return proto.CompactTextString(m) } -func (*EventUnSub) ProtoMessage() {} -func (*EventUnSub) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{2} -} -func (m *EventUnSub) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventUnSub.Unmarshal(m, b) -} -func (m *EventUnSub) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventUnSub.Marshal(b, m, deterministic) -} -func (dst *EventUnSub) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventUnSub.Merge(dst, src) -} -func (m *EventUnSub) XXX_Size() int { - return xxx_messageInfo_EventUnSub.Size(m) -} -func (m *EventUnSub) XXX_DiscardUnknown() { - xxx_messageInfo_EventUnSub.DiscardUnknown(m) -} - -var xxx_messageInfo_EventUnSub proto.InternalMessageInfo - -func (m *EventUnSub) GetResult() bool { - if m != nil { - return m.Result - } - return false -} - -type EventDataLog struct { - Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` - Height uint64 `protobuf:"varint,3,opt,name=Height,proto3" json:"Height,omitempty"` - Topics []string `protobuf:"bytes,4,rep,name=Topics,proto3" json:"Topics,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataLog) Reset() { *m = EventDataLog{} } -func (m *EventDataLog) String() string { return proto.CompactTextString(m) } -func (*EventDataLog) ProtoMessage() {} -func (*EventDataLog) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{3} -} -func (m *EventDataLog) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataLog.Unmarshal(m, b) -} -func (m *EventDataLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataLog.Marshal(b, m, deterministic) -} -func (dst *EventDataLog) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataLog.Merge(dst, src) -} -func (m *EventDataLog) XXX_Size() int { - return xxx_messageInfo_EventDataLog.Size(m) -} -func (m *EventDataLog) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataLog.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataLog proto.InternalMessageInfo - -func (m *EventDataLog) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *EventDataLog) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *EventDataLog) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *EventDataLog) GetTopics() []string { - if m != nil { - return m.Topics - } - return nil -} - -type EventDataTx struct { - Tx []byte `protobuf:"bytes,1,opt,name=Tx,proto3" json:"Tx,omitempty"` - Return []byte `protobuf:"bytes,2,opt,name=Return,proto3" json:"Return,omitempty"` - Exception string `protobuf:"bytes,3,opt,name=Exception,proto3" json:"Exception,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventDataTx) Reset() { *m = EventDataTx{} } -func (m *EventDataTx) String() string { return proto.CompactTextString(m) } -func (*EventDataTx) ProtoMessage() {} -func (*EventDataTx) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{4} -} -func (m *EventDataTx) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventDataTx.Unmarshal(m, b) -} -func (m *EventDataTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventDataTx.Marshal(b, m, deterministic) -} -func (dst *EventDataTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataTx.Merge(dst, src) -} -func (m *EventDataTx) XXX_Size() int { - return xxx_messageInfo_EventDataTx.Size(m) -} -func (m *EventDataTx) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataTx.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataTx proto.InternalMessageInfo - -func (m *EventDataTx) GetTx() []byte { - if m != nil { - return m.Tx - } - return nil -} - -func (m *EventDataTx) GetReturn() []byte { - if m != nil { - return m.Return - } - return nil -} - -func (m *EventDataTx) GetException() string { - if m != nil { - return m.Exception - } - return "" -} - -type Event struct { - Event string `protobuf:"bytes,1,opt,name=Event,proto3" json:"Event,omitempty"` - EventDataTx *EventDataTx `protobuf:"bytes,2,opt,name=EventDataTx,proto3" json:"EventDataTx,omitempty"` - EventDataCall *EventDataCall `protobuf:"bytes,3,opt,name=EventDataCall,proto3" json:"EventDataCall,omitempty"` - EventDataLog *EventDataLog `protobuf:"bytes,4,opt,name=EventDataLog,proto3" json:"EventDataLog,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{5} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Event.Unmarshal(m, b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) -} -func (dst *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(dst, src) -} -func (m *Event) XXX_Size() int { - return xxx_messageInfo_Event.Size(m) -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetEvent() string { - if m != nil { - return m.Event - } - return "" -} - -func (m *Event) GetEventDataTx() *EventDataTx { - if m != nil { - return m.EventDataTx - } - return nil -} - -func (m *Event) GetEventDataCall() *EventDataCall { - if m != nil { - return m.EventDataCall - } - return nil -} - -func (m *Event) GetEventDataLog() *EventDataLog { - if m != nil { - return m.EventDataLog - } - return nil -} - -type PollResponse struct { - Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PollResponse) Reset() { *m = PollResponse{} } -func (m *PollResponse) String() string { return proto.CompactTextString(m) } -func (*PollResponse) ProtoMessage() {} -func (*PollResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_event_c91b6cc4446486ab, []int{6} -} -func (m *PollResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PollResponse.Unmarshal(m, b) -} -func (m *PollResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PollResponse.Marshal(b, m, deterministic) -} -func (dst *PollResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PollResponse.Merge(dst, src) -} -func (m *PollResponse) XXX_Size() int { - return xxx_messageInfo_PollResponse.Size(m) -} -func (m *PollResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PollResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PollResponse proto.InternalMessageInfo - -func (m *PollResponse) GetEvents() []*Event { - if m != nil { - return m.Events - } - return nil -} - -func init() { - proto.RegisterType((*EventIdParam)(nil), "EventIdParam") - proto.RegisterType((*SubIdParam)(nil), "SubIdParam") - proto.RegisterType((*EventUnSub)(nil), "EventUnSub") - proto.RegisterType((*EventDataLog)(nil), "EventDataLog") - proto.RegisterType((*EventDataTx)(nil), "EventDataTx") - proto.RegisterType((*Event)(nil), "Event") - proto.RegisterType((*PollResponse)(nil), "PollResponse") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// EventsClient is the client API for Events service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EventsClient interface { - EventPoll(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*PollResponse, error) - EventSubscribe(ctx context.Context, in *EventIdParam, opts ...grpc.CallOption) (*SubIdParam, error) - EventUnsubscribe(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*EventUnSub, error) -} - -type eventsClient struct { - cc *grpc.ClientConn -} - -func NewEventsClient(cc *grpc.ClientConn) EventsClient { - return &eventsClient{cc} -} - -func (c *eventsClient) EventPoll(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*PollResponse, error) { - out := new(PollResponse) - err := c.cc.Invoke(ctx, "/Events/EventPoll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eventsClient) EventSubscribe(ctx context.Context, in *EventIdParam, opts ...grpc.CallOption) (*SubIdParam, error) { - out := new(SubIdParam) - err := c.cc.Invoke(ctx, "/Events/EventSubscribe", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eventsClient) EventUnsubscribe(ctx context.Context, in *SubIdParam, opts ...grpc.CallOption) (*EventUnSub, error) { - out := new(EventUnSub) - err := c.cc.Invoke(ctx, "/Events/EventUnsubscribe", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EventsServer is the server API for Events service. -type EventsServer interface { - EventPoll(context.Context, *SubIdParam) (*PollResponse, error) - EventSubscribe(context.Context, *EventIdParam) (*SubIdParam, error) - EventUnsubscribe(context.Context, *SubIdParam) (*EventUnSub, error) -} - -func RegisterEventsServer(s *grpc.Server, srv EventsServer) { - s.RegisterService(&_Events_serviceDesc, srv) -} - -func _Events_EventPoll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubIdParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventsServer).EventPoll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Events/EventPoll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventsServer).EventPoll(ctx, req.(*SubIdParam)) - } - return interceptor(ctx, in, info, handler) -} - -func _Events_EventSubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EventIdParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventsServer).EventSubscribe(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Events/EventSubscribe", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventsServer).EventSubscribe(ctx, req.(*EventIdParam)) - } - return interceptor(ctx, in, info, handler) -} - -func _Events_EventUnsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubIdParam) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EventsServer).EventUnsubscribe(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Events/EventUnsubscribe", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EventsServer).EventUnsubscribe(ctx, req.(*SubIdParam)) - } - return interceptor(ctx, in, info, handler) -} - -var _Events_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Events", - HandlerType: (*EventsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EventPoll", - Handler: _Events_EventPoll_Handler, - }, - { - MethodName: "EventSubscribe", - Handler: _Events_EventSubscribe_Handler, - }, - { - MethodName: "EventUnsubscribe", - Handler: _Events_EventUnsubscribe_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "event.proto", -} - -func init() { proto.RegisterFile("event.proto", fileDescriptor_event_c91b6cc4446486ab) } - -var fileDescriptor_event_c91b6cc4446486ab = []byte{ - // 389 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xdf, 0xaa, 0x9b, 0x40, - 0x10, 0xc6, 0x31, 0xf1, 0xd8, 0xe3, 0x68, 0x42, 0x59, 0x4a, 0x91, 0x43, 0x29, 0x61, 0x29, 0xd4, - 0x8b, 0xb0, 0x50, 0xdb, 0x17, 0xe8, 0x9f, 0x40, 0x0b, 0xbd, 0x08, 0xab, 0xbd, 0xe9, 0x9d, 0x9a, - 0x25, 0x15, 0x8c, 0x2b, 0xbb, 0xda, 0xfa, 0x12, 0x7d, 0x9d, 0x3e, 0x5f, 0xd9, 0x71, 0x4d, 0xb2, - 0x77, 0xf3, 0xfb, 0xfc, 0x66, 0xbe, 0x65, 0x1c, 0x88, 0xc4, 0x6f, 0xd1, 0x0d, 0xac, 0x57, 0x72, - 0x90, 0x4f, 0x71, 0x2d, 0x2f, 0x17, 0xd9, 0xcd, 0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73, 0x54, - 0xee, 0x9a, 0xc8, 0x3b, 0x77, 0x91, 0x89, 0x8f, 0x4d, 0x1b, 0x76, 0x2f, 0x72, 0xc7, 0x42, 0x19, - 0xc4, 0x47, 0xd9, 0xb6, 0x5c, 0xe8, 0x5e, 0x76, 0x5a, 0x90, 0xd7, 0x10, 0xe0, 0x0f, 0x36, 0xab, - 0x5f, 0xa7, 0x51, 0x16, 0xcc, 0xcd, 0xdc, 0xaa, 0xd9, 0x5f, 0x0f, 0x02, 0x54, 0x34, 0x79, 0x0b, - 0x21, 0x56, 0xa6, 0x9f, 0x44, 0xec, 0x76, 0x0c, 0x4f, 0x1b, 0xe6, 0xcc, 0xdc, 0xc3, 0x16, 0x8d, - 0xf9, 0x58, 0xe9, 0x5a, 0x35, 0x95, 0x20, 0xf6, 0x49, 0x8b, 0xff, 0xbe, 0x99, 0xec, 0xe1, 0xb9, - 0xbd, 0x19, 0x7d, 0xf5, 0x3b, 0xd3, 0x23, 0x76, 0xbb, 0xa9, 0x4f, 0x8f, 0x3f, 0x83, 0x6a, 0x54, - 0x4a, 0xfe, 0xa9, 0x02, 0x3c, 0xe0, 0xf7, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x23, 0x80, - 0xae, 0xdd, 0x02, 0x00, 0x00, -} diff --git a/rpc/burrow/event.proto b/rpc/burrow/event.proto deleted file mode 100644 index b55fcc03782962e2547deeefed8bcba1d521a1d5..0000000000000000000000000000000000000000 --- a/rpc/burrow/event.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = 'proto3'; - -option go_package = "burrow"; - -import "common.proto"; - -// Event Service Definition -service Events { - rpc EventPoll (SubIdParam) returns (PollResponse); - rpc EventSubscribe (EventIdParam) returns (SubIdParam); - rpc EventUnsubscribe (SubIdParam) returns (EventUnSub); -} - -// Params -message EventIdParam { - string eventId = 1; -} - -message SubIdParam { - string subId = 1; -} - -// Results -message EventUnSub { - bool result = 1; -} - -message EventDataLog { - bytes Address = 1; - bytes Data = 2; - uint64 Height = 3; - repeated string Topics = 4; -} - -message EventDataTx { - bytes Tx = 1; - bytes Return = 2; - string Exception = 3; -} - -message Event { - string Event = 1; // This message is missing the tendermint object part. this might not be important? - EventDataTx EventDataTx = 2; - EventDataCall EventDataCall = 3; - EventDataLog EventDataLog = 4; -} - - -message PollResponse { - repeated Event events = 1; -} -//-------------------------------------------------- - diff --git a/rpc/burrow/namereg.pb.go b/rpc/burrow/namereg.pb.go index 4c46b6e0d695e72d38aef7ba2e8998c3150a856a..35da753e0137ee12ffd8de452ad7600fbf22c81b 100644 --- a/rpc/burrow/namereg.pb.go +++ b/rpc/burrow/namereg.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: namereg.proto +// source: rpc/burrow/namereg.proto package burrow @@ -35,7 +35,7 @@ func (m *NameRegEntryParam) Reset() { *m = NameRegEntryParam{} } func (m *NameRegEntryParam) String() string { return proto.CompactTextString(m) } func (*NameRegEntryParam) ProtoMessage() {} func (*NameRegEntryParam) Descriptor() ([]byte, []int) { - return fileDescriptor_namereg_66557e780bd2c0c8, []int{0} + return fileDescriptor_namereg_4496634bf2190c58, []int{0} } func (m *NameRegEntryParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NameRegEntryParam.Unmarshal(m, b) @@ -77,7 +77,7 @@ func (m *TransactNameRegParam) Reset() { *m = TransactNameRegParam{} } func (m *TransactNameRegParam) String() string { return proto.CompactTextString(m) } func (*TransactNameRegParam) ProtoMessage() {} func (*TransactNameRegParam) Descriptor() ([]byte, []int) { - return fileDescriptor_namereg_66557e780bd2c0c8, []int{1} + return fileDescriptor_namereg_4496634bf2190c58, []int{1} } func (m *TransactNameRegParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransactNameRegParam.Unmarshal(m, b) @@ -148,7 +148,7 @@ func (m *NameRegEntry) Reset() { *m = NameRegEntry{} } func (m *NameRegEntry) String() string { return proto.CompactTextString(m) } func (*NameRegEntry) ProtoMessage() {} func (*NameRegEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_namereg_66557e780bd2c0c8, []int{2} + return fileDescriptor_namereg_4496634bf2190c58, []int{2} } func (m *NameRegEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NameRegEntry.Unmarshal(m, b) @@ -208,7 +208,7 @@ func (m *NameRegEntryList) Reset() { *m = NameRegEntryList{} } func (m *NameRegEntryList) String() string { return proto.CompactTextString(m) } func (*NameRegEntryList) ProtoMessage() {} func (*NameRegEntryList) Descriptor() ([]byte, []int) { - return fileDescriptor_namereg_66557e780bd2c0c8, []int{3} + return fileDescriptor_namereg_4496634bf2190c58, []int{3} } func (m *NameRegEntryList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NameRegEntryList.Unmarshal(m, b) @@ -417,34 +417,35 @@ var _NameReg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "namereg.proto", -} - -func init() { proto.RegisterFile("namereg.proto", fileDescriptor_namereg_66557e780bd2c0c8) } - -var fileDescriptor_namereg_66557e780bd2c0c8 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x4f, 0x4f, 0xea, 0x40, - 0x10, 0x4f, 0xa1, 0xfc, 0x79, 0x43, 0xc9, 0x83, 0x0d, 0x8f, 0x34, 0x9c, 0x9a, 0xbe, 0xc3, 0xe3, - 0xf2, 0x9a, 0x80, 0x9e, 0x4d, 0x20, 0xa2, 0x98, 0x18, 0x34, 0x1b, 0x2e, 0x7a, 0x5b, 0xca, 0x80, - 0x8d, 0x74, 0xb7, 0xd9, 0x2e, 0x01, 0x3f, 0x8b, 0x9f, 0xce, 0x6f, 0x62, 0xb6, 0xad, 0xba, 0x80, - 0xde, 0x66, 0x7e, 0xfd, 0xfd, 0x99, 0xe9, 0x2c, 0x34, 0x39, 0x8b, 0x51, 0xe2, 0x3a, 0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x36, 0x7c, 0xb3, 0xa0, 0x56, 0xe0, 0xe4, 0x3f, 0xd4, 0xaf, 0x51, - 0x15, 0xab, 0x04, 0x27, 0x07, 0xea, 0x1d, 0x3a, 0x90, 0x01, 0x40, 0x41, 0x8f, 0x30, 0x25, 0xad, - 0xe0, 0x2a, 0xda, 0x28, 0x94, 0x7a, 0xb8, 0x9c, 0xde, 0x0e, 0x4e, 0x86, 0x3e, 0x87, 0xdf, 0x47, - 0xd7, 0x24, 0x7f, 0x82, 0xef, 0xee, 0xdb, 0x83, 0x60, 0xbe, 0xa7, 0x18, 0x62, 0x94, 0x28, 0x72, - 0x01, 0xdd, 0x23, 0xce, 0x88, 0x2f, 0xa7, 0x62, 0xb3, 0xfc, 0x49, 0x7c, 0x38, 0xe8, 0xb8, 0xfe, - 0x58, 0x5d, 0x6c, 0xa5, 0x14, 0xbb, 0x45, 0x35, 0x7b, 0x7e, 0x67, 0xef, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x5c, 0x0a, 0xab, 0x0f, 0x9d, 0x02, 0x00, 0x00, + Metadata: "rpc/burrow/namereg.proto", +} + +func init() { proto.RegisterFile("rpc/burrow/namereg.proto", fileDescriptor_namereg_4496634bf2190c58) } + +var fileDescriptor_namereg_4496634bf2190c58 = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x5d, 0x4f, 0x2a, 0x31, + 0x10, 0xcd, 0xc2, 0xf2, 0x71, 0x07, 0x6e, 0x2e, 0x34, 0x5c, 0xee, 0x86, 0xa7, 0xcd, 0xde, 0x07, + 0x79, 0x71, 0x09, 0xe8, 0xb3, 0x09, 0x44, 0x14, 0x13, 0x83, 0xa6, 0xe1, 0x45, 0xdf, 0xca, 0x52, + 0x70, 0x23, 0xdb, 0x6e, 0xba, 0x25, 0xe0, 0x6f, 0xf1, 0xd7, 0xf9, 0x4f, 0x4c, 0xdb, 0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d4, 0x46, 0x6b, 0x1e, 0x3d, 0x4f, 0x68, 0xbc, 0x7a, 0x32, 0xfb, 0xbb, + 0xd8, 0x86, 0xd0, 0x7f, 0x28, 0xa9, 0xae, 0xcc, 0x2b, 0xf8, 0x45, 0xfd, 0x36, 0xb6, 0x06, 0x36, + 0xb5, 0xc1, 0x9b, 0x03, 0x95, 0x1c, 0x47, 0xa7, 0x50, 0xbd, 0xa6, 0x32, 0x5f, 0x25, 0x3c, 0x3a, + 0x50, 0x67, 0x5f, 0x01, 0xf5, 0x01, 0x72, 0x7a, 0x4c, 0x33, 0xd4, 0x08, 0xaf, 0xe2, 0xb5, 0xa4, + 0x42, 0x0d, 0x67, 0xe8, 0xcd, 0xf0, 0x68, 0xe8, 0x73, 0xf8, 0x73, 0x70, 0x4d, 0xf4, 0x37, 0xfc, + 0xee, 0xbe, 0x1d, 0x08, 0x67, 0x3b, 0x4c, 0x23, 0x1a, 0xa7, 0x12, 0x5d, 0x40, 0xfb, 0x80, 0x33, + 0x64, 0x8b, 0x09, 0x5f, 0x2f, 0x7e, 0x6a, 0xde, 0x1f, 0x74, 0x54, 0x7d, 0x2c, 0x9b, 0x4f, 0x38, + 0x2f, 0xeb, 0xef, 0x77, 0xf6, 0x1e, 0x00, 0x00, 0xff, 0xff, 0x69, 0xcb, 0xf2, 0xea, 0xb3, 0x02, + 0x00, 0x00, } diff --git a/rpc/burrow/namereg.proto b/rpc/burrow/namereg.proto index aba10bf52e7e2769e8961a9f987c552bbd53b535..0462e88a00fb54538075bee4c42569daf17d5ffc 100644 --- a/rpc/burrow/namereg.proto +++ b/rpc/burrow/namereg.proto @@ -2,7 +2,7 @@ syntax = 'proto3'; option go_package = "burrow"; -import "common.proto"; +import "rpc/burrow/common.proto"; // Name Registry Service Definition service NameReg { diff --git a/rpc/burrow/network.pb.go b/rpc/burrow/network.pb.go index 959294cf16e1b0b777df25ac64bcf39ef3ebdf40..fccd3423dce48dfb55e0beed66193ebbfc0ca708 100644 --- a/rpc/burrow/network.pb.go +++ b/rpc/burrow/network.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// source: network.proto +// source: rpc/burrow/network.proto package burrow @@ -35,7 +35,7 @@ func (m *PeerParam) Reset() { *m = PeerParam{} } func (m *PeerParam) String() string { return proto.CompactTextString(m) } func (*PeerParam) ProtoMessage() {} func (*PeerParam) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{0} + return fileDescriptor_network_549d0b14318a838d, []int{0} } func (m *PeerParam) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PeerParam.Unmarshal(m, b) @@ -74,7 +74,7 @@ func (m *ClientVersion) Reset() { *m = ClientVersion{} } func (m *ClientVersion) String() string { return proto.CompactTextString(m) } func (*ClientVersion) ProtoMessage() {} func (*ClientVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{1} + return fileDescriptor_network_549d0b14318a838d, []int{1} } func (m *ClientVersion) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClientVersion.Unmarshal(m, b) @@ -113,7 +113,7 @@ func (m *NodeID) Reset() { *m = NodeID{} } func (m *NodeID) String() string { return proto.CompactTextString(m) } func (*NodeID) ProtoMessage() {} func (*NodeID) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{2} + return fileDescriptor_network_549d0b14318a838d, []int{2} } func (m *NodeID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NodeID.Unmarshal(m, b) @@ -164,7 +164,7 @@ func (m *NodeInfo) Reset() { *m = NodeInfo{} } func (m *NodeInfo) String() string { return proto.CompactTextString(m) } func (*NodeInfo) ProtoMessage() {} func (*NodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{3} + return fileDescriptor_network_549d0b14318a838d, []int{3} } func (m *NodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NodeInfo.Unmarshal(m, b) @@ -246,7 +246,7 @@ func (m *NetworkInfo) Reset() { *m = NetworkInfo{} } func (m *NetworkInfo) String() string { return proto.CompactTextString(m) } func (*NetworkInfo) ProtoMessage() {} func (*NetworkInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{4} + return fileDescriptor_network_549d0b14318a838d, []int{4} } func (m *NetworkInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NetworkInfo.Unmarshal(m, b) @@ -299,7 +299,7 @@ func (m *Peer) Reset() { *m = Peer{} } func (m *Peer) String() string { return proto.CompactTextString(m) } func (*Peer) ProtoMessage() {} func (*Peer) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{5} + return fileDescriptor_network_549d0b14318a838d, []int{5} } func (m *Peer) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Peer.Unmarshal(m, b) @@ -344,7 +344,7 @@ func (m *PeerList) Reset() { *m = PeerList{} } func (m *PeerList) String() string { return proto.CompactTextString(m) } func (*PeerList) ProtoMessage() {} func (*PeerList) Descriptor() ([]byte, []int) { - return fileDescriptor_network_c897a21d5e309ba4, []int{6} + return fileDescriptor_network_549d0b14318a838d, []int{6} } func (m *PeerList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PeerList.Unmarshal(m, b) @@ -582,39 +582,39 @@ var _Network_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "network.proto", + Metadata: "rpc/burrow/network.proto", } -func init() { proto.RegisterFile("network.proto", fileDescriptor_network_c897a21d5e309ba4) } +func init() { proto.RegisterFile("rpc/burrow/network.proto", fileDescriptor_network_549d0b14318a838d) } -var fileDescriptor_network_c897a21d5e309ba4 = []byte{ - // 436 bytes of a gzipped FileDescriptorProto +var fileDescriptor_network_549d0b14318a838d = []byte{ + // 445 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x53, 0xcf, 0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 0x4f, 0xb0, 0xe0, 0xe7, 0x25, 0xc0, 0x52, 0xdd, 0x1d, 0xf4, 0x46, 0x1c, + 0x78, 0x69, 0x6d, 0x4b, 0x58, 0x8b, 0xc9, 0xde, 0x41, 0x62, 0xc6, 0x99, 0xe5, 0x61, 0x6f, 0xf4, + 0xff, 0xde, 0xd9, 0x9f, 0xe8, 0x68, 0x30, 0xf9, 0x00, 0x2f, 0x17, 0xa8, 0x4f, 0xff, 0x8d, 0x38, + 0xff, 0x5a, 0xef, 0xf5, 0xf3, 0xe8, 0x3c, 0x3f, 0xe5, 0xdf, 0xc2, 0xf9, 0x02, 0x75, 0xdb, 0x1a, + 0x5f, 0x79, 0x96, 0xb7, 0xd9, 0x09, 0x0c, 0x4d, 0x9d, 0xbf, 0xdb, 0x17, 0x05, 0x51, 0x64, 0x0c, + 0x83, 0x05, 0x6a, 0x2b, 0x1e, 0xf2, 0xe3, 0xff, 0x3b, 0x72, 0x67, 0x92, 0x37, 0x90, 0x34, 0x59, + 0xd5, 0x6a, 0xf6, 0xda, 0xbe, 0x24, 0x3f, 0x63, 0xf7, 0x12, 0x36, 0xb1, 0x7d, 0x03, 0x1f, 0xff, + 0x05, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x95, 0xeb, 0x57, 0x38, 0x03, 0x00, 0x00, } diff --git a/rpc/burrow/network.proto b/rpc/burrow/network.proto index 78778bc5e779e51e8e93c7c3d483db3b6b265eb6..093b2e24e7c4899967d4d9f41fde022fc6fe4a21 100644 --- a/rpc/burrow/network.proto +++ b/rpc/burrow/network.proto @@ -2,7 +2,7 @@ syntax = 'proto3'; option go_package = "burrow"; -import "common.proto"; +import "rpc/burrow/common.proto"; // Network Service Definition service Network { diff --git a/rpc/burrow/transaction_server.go b/rpc/burrow/transaction_server.go deleted file mode 100644 index d2c5dc6145815baf52b8067482e223285d1a5d69..0000000000000000000000000000000000000000 --- a/rpc/burrow/transaction_server.go +++ /dev/null @@ -1,206 +0,0 @@ -package burrow - -import ( - acm "github.com/hyperledger/burrow/account" - "github.com/hyperledger/burrow/account/state" - "github.com/hyperledger/burrow/crypto" - "github.com/hyperledger/burrow/execution" - "github.com/hyperledger/burrow/execution/evm/events" - "github.com/hyperledger/burrow/rpc" - "github.com/hyperledger/burrow/txs" - "golang.org/x/net/context" -) - -type transactionServer struct { - service *rpc.Service - txCodec txs.Codec - reader state.Reader -} - -func NewTransactionServer(service *rpc.Service, reader state.Reader, txCodec txs.Codec) TransactionServer { - return &transactionServer{ - service: service, - reader: reader, - txCodec: txCodec, - } -} - -func (ts *transactionServer) BroadcastTx(ctx context.Context, param *TxParam) (*TxReceipt, error) { - receipt, err := ts.service.Transactor().BroadcastTxRaw(param.GetTx()) - if err != nil { - return nil, err - } - return txReceipt(receipt), nil -} - -func (ts *transactionServer) Call(ctx context.Context, param *CallParam) (*CallResult, error) { - fromAddress, err := crypto.AddressFromBytes(param.GetFrom()) - if err != nil { - return nil, err - } - address, err := crypto.AddressFromBytes(param.GetAddress()) - if err != nil { - return nil, err - } - call, err := ts.service.Transactor().Call(ts.reader, fromAddress, address, param.GetData()) - return &CallResult{ - Return: call.Return, - GasUsed: call.GasUsed, - }, nil -} - -func (ts *transactionServer) CallCode(ctx context.Context, param *CallCodeParam) (*CallResult, error) { - fromAddress, err := crypto.AddressFromBytes(param.GetFrom()) - if err != nil { - return nil, err - } - call, err := ts.service.Transactor().CallCode(ts.reader, fromAddress, param.GetCode(), param.GetData()) - return &CallResult{ - Return: call.Return, - GasUsed: call.GasUsed, - }, nil -} - -func (ts *transactionServer) Transact(ctx context.Context, param *TransactParam) (*TxReceipt, error) { - inputAccount, err := ts.inputAccount(param.GetInputAccount()) - if err != nil { - return nil, err - } - address, err := crypto.MaybeAddressFromBytes(param.GetAddress()) - if err != nil { - return nil, err - } - receipt, err := ts.service.Transactor().Transact(inputAccount, address, param.GetData(), param.GetGasLimit(), - param.GetFee()) - if err != nil { - return nil, err - } - return txReceipt(receipt), nil -} - -func (ts *transactionServer) TransactAndHold(ctx context.Context, param *TransactParam) (*EventDataCall, error) { - inputAccount, err := ts.inputAccount(param.GetInputAccount()) - if err != nil { - return nil, err - } - address, err := crypto.MaybeAddressFromBytes(param.GetAddress()) - if err != nil { - return nil, err - } - edt, err := ts.service.Transactor().TransactAndHold(ctx, inputAccount, address, param.GetData(), - param.GetGasLimit(), param.GetFee()) - if err != nil { - return nil, err - } - return eventDataCall(edt), nil -} - -func (ts *transactionServer) Send(ctx context.Context, param *SendParam) (*TxReceipt, error) { - inputAccount, err := ts.inputAccount(param.GetInputAccount()) - if err != nil { - return nil, err - } - toAddress, err := crypto.AddressFromBytes(param.GetToAddress()) - if err != nil { - return nil, err - } - receipt, err := ts.service.Transactor().Send(inputAccount, toAddress, param.GetAmount()) - if err != nil { - return nil, err - } - return txReceipt(receipt), nil -} - -func (ts *transactionServer) SendAndHold(ctx context.Context, param *SendParam) (*TxReceipt, error) { - inputAccount, err := ts.inputAccount(param.GetInputAccount()) - if err != nil { - return nil, err - } - toAddress, err := crypto.AddressFromBytes(param.GetToAddress()) - if err != nil { - return nil, err - } - receipt, err := ts.service.Transactor().SendAndHold(ctx, inputAccount, toAddress, param.GetAmount()) - if err != nil { - return nil, err - } - return txReceipt(receipt), nil -} - -func (ts *transactionServer) SignTx(ctx context.Context, param *SignTxParam) (*SignedTx, error) { - txEnv, err := ts.txCodec.DecodeTx(param.GetTx()) - if err != nil { - return nil, err - } - signers, err := signersFromPrivateAccounts(param.GetPrivateAccounts()) - if err != nil { - return nil, err - } - txEnvSigned, err := ts.service.Transactor().SignTx(txEnv, signers) - if err != nil { - return nil, err - } - bs, err := ts.txCodec.EncodeTx(txEnvSigned) - if err != nil { - return nil, err - } - return &SignedTx{ - Tx: bs, - }, nil -} - -func (ts *transactionServer) inputAccount(inAcc *InputAccount) (*execution.SequentialSigningAccount, error) { - return ts.service.SigningAccount(inAcc.GetAddress(), inAcc.GetPrivateKey()) -} - -func eventDataCall(edt *events.EventDataCall) *EventDataCall { - return &EventDataCall{ - Origin: edt.Origin.Bytes(), - TxHash: edt.TxHash, - CallData: callData(edt.CallData), - StackDepth: int64(edt.StackDepth), - Return: edt.Return, - Exception: edt.Exception.Error(), - } -} -func callData(cd *events.CallData) *CallData { - return &CallData{ - Caller: cd.Caller.Bytes(), - Callee: cd.Callee.Bytes(), - Data: cd.Data, - Gas: cd.Gas, - } -} - -func txReceipt(receipt *txs.Receipt) *TxReceipt { - return &TxReceipt{ - ContractAddress: receipt.ContractAddress.Bytes(), - CreatesContract: receipt.CreatesContract, - TxHash: receipt.TxHash, - } -} - -func signersFromPrivateAccounts(privateAccounts []*PrivateAccount) ([]acm.AddressableSigner, error) { - signers := make([]acm.AddressableSigner, len(privateAccounts)) - var err error - for i, pa := range privateAccounts { - signers[i], err = privateAccount(pa) - if err != nil { - return nil, err - } - } - return signers, nil -} - -func privateAccount(privateAccount *PrivateAccount) (acm.PrivateAccount, error) { - privateKey, err := crypto.PrivateKeyFromRawBytes(privateAccount.PrivateKey, crypto.CurveTypeEd25519) - if err != nil { - return nil, err - } - publicKey := privateKey.GetPublicKey() - return acm.ConcretePrivateAccount{ - Address: publicKey.Address(), - PrivateKey: privateKey, - PublicKey: publicKey, - }.PrivateAccount(), nil -} diff --git a/rpc/result.go b/rpc/result.go index 05ab9a853b6f11b1bb1566e035daac72ae56fa4d..bcf23863bc2e18dd4cc0dd1d0fb5aaa59a65f4d2 100644 --- a/rpc/result.go +++ b/rpc/result.go @@ -22,8 +22,7 @@ import ( "github.com/hyperledger/burrow/binary" "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/execution" - exeEvents "github.com/hyperledger/burrow/execution/events" - evmEvents "github.com/hyperledger/burrow/execution/evm/events" + "github.com/hyperledger/burrow/execution/events" "github.com/hyperledger/burrow/execution/names" "github.com/hyperledger/burrow/genesis" "github.com/hyperledger/burrow/txs" @@ -239,11 +238,9 @@ func (te *TendermintEvent) EventDataNewBlock() *tmTypes.EventDataNewBlock { } type ResultEvent struct { - Event string - Tendermint *TendermintEvent `json:",omitempty"` - EventDataTx *exeEvents.EventDataTx `json:",omitempty"` - EventDataCall *evmEvents.EventDataCall `json:",omitempty"` - EventDataLog *evmEvents.EventDataLog `json:",omitempty"` + Event string + Tendermint *TendermintEvent `json:",omitempty"` + Execution *events.Event `json:",omitempty"` } // Map any supported event data element to our ResultEvent sum type @@ -254,12 +251,8 @@ func NewResultEvent(event string, eventData interface{}) (*ResultEvent, error) { switch ed := eventData.(type) { case tmTypes.TMEventData: res.Tendermint = &TendermintEvent{ed} - case *exeEvents.EventDataTx: - res.EventDataTx = ed - case *evmEvents.EventDataCall: - res.EventDataCall = ed - case *evmEvents.EventDataLog: - res.EventDataLog = ed + case *events.Event: + res.Execution = ed default: return nil, fmt.Errorf("could not map event data of type %T to ResultEvent", eventData) } diff --git a/rpc/rpcevents/events_server.go b/rpc/rpcevents/events_server.go new file mode 100644 index 0000000000000000000000000000000000000000..7ee673c5f6a84022ff525d510225e800849c2fd8 --- /dev/null +++ b/rpc/rpcevents/events_server.go @@ -0,0 +1,54 @@ +package rpcevents + +import ( + "github.com/hyperledger/burrow/execution/events/pbevents" + "github.com/hyperledger/burrow/rpc" + "golang.org/x/net/context" +) + +type eventServer struct { + subscriptions *rpc.Subscriptions +} + +func NewEventsServer(subscriptions *rpc.Subscriptions) pbevents.EventsServer { + return &eventServer{ + subscriptions: subscriptions, + } +} + +func (es *eventServer) EventPoll(ctx context.Context, param *pbevents.SubIdParam) (*pbevents.PollResponse, error) { + msgs, err := es.subscriptions.Poll(param.GetSubId()) + if err != nil { + return nil, err + } + resp := &pbevents.PollResponse{ + Events: make([]*pbevents.ExecutionEvent, 0, len(msgs)), + } + for _, msg := range msgs { + ev := pbevents.GetEvent(msg) + if ev != nil { + resp.Events = append(resp.Events, ev) + } + } + return resp, nil +} + +func (es *eventServer) EventSubscribe(ctx context.Context, param *pbevents.EventIdParam) (*pbevents.SubIdParam, error) { + subID, err := es.subscriptions.Add(param.GetEventId()) + if err != nil { + return nil, err + } + return &pbevents.SubIdParam{ + SubId: subID, + }, nil +} + +func (es *eventServer) EventUnsubscribe(ctx context.Context, param *pbevents.SubIdParam) (*pbevents.EventUnSub, error) { + err := es.subscriptions.Remove(param.GetSubId()) + if err != nil { + return nil, err + } + return &pbevents.EventUnSub{ + Result: true, + }, nil +} diff --git a/rpc/rpcevents/execution_events_server.go b/rpc/rpcevents/execution_events_server.go new file mode 100644 index 0000000000000000000000000000000000000000..b7e22e2ca780db8f1ad585e8196c38a8f80a5be7 --- /dev/null +++ b/rpc/rpcevents/execution_events_server.go @@ -0,0 +1,17 @@ +package rpcevents + +import ( + "github.com/hyperledger/burrow/execution/events/pbevents" + "golang.org/x/net/context" +) + +type executionEventsServer struct { +} + +func NewExecutionEventsServer() pbevents.ExecutionEventsServer { + return &executionEventsServer{} +} + +func (executionEventsServer) GetEvents(context.Context, *pbevents.GetEventsRequest) (*pbevents.GetEventsResponse, error) { + panic("implement me") +} diff --git a/rpc/burrow/integration/main_test.go b/rpc/rpctransactor/integration/main_test.go similarity index 100% rename from rpc/burrow/integration/main_test.go rename to rpc/rpctransactor/integration/main_test.go diff --git a/rpc/burrow/integration/strange_loop.go b/rpc/rpctransactor/integration/strange_loop.go similarity index 100% rename from rpc/burrow/integration/strange_loop.go rename to rpc/rpctransactor/integration/strange_loop.go diff --git a/rpc/burrow/integration/strange_loop.sh b/rpc/rpctransactor/integration/strange_loop.sh similarity index 100% rename from rpc/burrow/integration/strange_loop.sh rename to rpc/rpctransactor/integration/strange_loop.sh diff --git a/rpc/burrow/integration/strange_loop.sol b/rpc/rpctransactor/integration/strange_loop.sol similarity index 100% rename from rpc/burrow/integration/strange_loop.sol rename to rpc/rpctransactor/integration/strange_loop.sol diff --git a/rpc/burrow/integration/transaction_service_test.go b/rpc/rpctransactor/integration/transactor_server_test.go similarity index 86% rename from rpc/burrow/integration/transaction_service_test.go rename to rpc/rpctransactor/integration/transactor_server_test.go index db7f825489c76fb74a429cdfd03603f444b47b2b..810989cbd6f03d651e741d688b6e863e70d3ddee 100644 --- a/rpc/burrow/integration/transaction_service_test.go +++ b/rpc/rpctransactor/integration/transactor_server_test.go @@ -27,8 +27,8 @@ import ( "github.com/hyperledger/burrow/binary" "github.com/hyperledger/burrow/consensus/tendermint" "github.com/hyperledger/burrow/execution/evm/abi" + "github.com/hyperledger/burrow/execution/pbtransactor" "github.com/hyperledger/burrow/rpc" - "github.com/hyperledger/burrow/rpc/burrow" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/types" @@ -44,7 +44,7 @@ func TestTransactCallNoCode(t *testing.T) { numCreates := 1000 countCh := committedTxCount(t) for i := 0; i < numCreates; i++ { - receipt, err := cli.Transact(context.Background(), &burrow.TransactParam{ + receipt, err := cli.Transact(context.Background(), &pbtransactor.TransactParam{ InputAccount: inputAccount(i), Address: toAddress.Bytes(), Data: []byte{}, @@ -71,7 +71,7 @@ func TestTransactCreate(t *testing.T) { for i := 0; i < numGoroutines; i++ { go func() { for j := 0; j < numCreates; j++ { - create, err := cli.Transact(context.Background(), &burrow.TransactParam{ + create, err := cli.Transact(context.Background(), &pbtransactor.TransactParam{ InputAccount: inputAccount(i), Address: nil, Data: bc, @@ -95,7 +95,7 @@ func BenchmarkTransactCreateContract(b *testing.B) { bc, err := hex.DecodeString(strangeLoopBytecode) require.NoError(b, err) for i := 0; i < b.N; i++ { - create, err := cli.Transact(context.Background(), &burrow.TransactParam{ + create, err := cli.Transact(context.Background(), &pbtransactor.TransactParam{ InputAccount: inputAccount(i), Address: nil, Data: bc, @@ -116,7 +116,7 @@ func TestTransactAndHold(t *testing.T) { countCh := committedTxCount(t) for i := 0; i < numGoroutines; i++ { for j := 0; j < numRuns; j++ { - create, err := cli.TransactAndHold(context.Background(), &burrow.TransactParam{ + create, err := cli.TransactAndHold(context.Background(), &pbtransactor.TransactParam{ InputAccount: inputAccount(i), Address: nil, Data: bc, @@ -124,9 +124,9 @@ func TestTransactAndHold(t *testing.T) { GasLimit: 10000, }) require.NoError(t, err) - assert.Equal(t, int64(0), create.StackDepth) + assert.Equal(t, uint64(0), create.StackDepth) functionID := abi.FunctionID("UpsieDownsie()") - call, err := cli.TransactAndHold(context.Background(), &burrow.TransactParam{ + call, err := cli.TransactAndHold(context.Background(), &pbtransactor.TransactParam{ InputAccount: inputAccount(i), Address: create.CallData.Callee, Data: functionID[:], @@ -147,7 +147,7 @@ func TestSend(t *testing.T) { numSends := 1000 countCh := committedTxCount(t) for i := 0; i < numSends; i++ { - send, err := cli.Send(context.Background(), &burrow.SendParam{ + send, err := cli.Send(context.Background(), &pbtransactor.SendParam{ InputAccount: inputAccount(i), Amount: 2003, ToAddress: privateAccounts[3].Address().Bytes(), @@ -161,7 +161,7 @@ func TestSend(t *testing.T) { func TestSendAndHold(t *testing.T) { cli := newClient(t) for i := 0; i < 2; i++ { - send, err := cli.SendAndHold(context.Background(), &burrow.SendParam{ + send, err := cli.SendAndHold(context.Background(), &pbtransactor.SendParam{ InputAccount: inputAccount(i), Amount: 2003, ToAddress: privateAccounts[3].Address().Bytes(), @@ -172,10 +172,10 @@ func TestSendAndHold(t *testing.T) { } // Helpers -func newClient(t testing.TB) burrow.TransactionClient { +func newClient(t testing.TB) pbtransactor.TransactorClient { conn, err := grpc.Dial(rpc.DefaultGRPCConfig().ListenAddress, grpc.WithInsecure()) require.NoError(t, err) - return burrow.NewTransactionClient(conn) + return pbtransactor.NewTransactorClient(conn) } var committedTxCountIndex = 0 @@ -213,8 +213,8 @@ func committedTxCount(t *testing.T) chan int { var inputPrivateKey = privateAccounts[0].PrivateKey().RawBytes() var inputAddress = privateAccounts[0].Address().Bytes() -func inputAccount(i int) *burrow.InputAccount { - ia := new(burrow.InputAccount) +func inputAccount(i int) *pbtransactor.InputAccount { + ia := new(pbtransactor.InputAccount) if i%2 == 0 { ia.PrivateKey = inputPrivateKey } else { diff --git a/rpc/rpctransactor/transactor_server.go b/rpc/rpctransactor/transactor_server.go new file mode 100644 index 0000000000000000000000000000000000000000..53c973fd0b647d1fffd4216a5280a42381c55ec5 --- /dev/null +++ b/rpc/rpctransactor/transactor_server.go @@ -0,0 +1,190 @@ +package rpctransactor + +import ( + acm "github.com/hyperledger/burrow/account" + "github.com/hyperledger/burrow/account/state" + "github.com/hyperledger/burrow/crypto" + "github.com/hyperledger/burrow/execution" + "github.com/hyperledger/burrow/execution/events/pbevents" + "github.com/hyperledger/burrow/execution/pbtransactor" + "github.com/hyperledger/burrow/txs" + "golang.org/x/net/context" +) + +type transactorServer struct { + transactor *execution.Transactor + accounts *execution.Accounts + txCodec txs.Codec + reader state.Reader +} + +func NewTransactorServer(transactor *execution.Transactor, accounts *execution.Accounts, reader state.Reader, + txCodec txs.Codec) pbtransactor.TransactorServer { + return &transactorServer{ + transactor: transactor, + accounts: accounts, + reader: reader, + txCodec: txCodec, + } +} + +func (ts *transactorServer) BroadcastTx(ctx context.Context, param *pbtransactor.TxParam) (*pbtransactor.TxReceipt, error) { + receipt, err := ts.transactor.BroadcastTxRaw(param.GetTx()) + if err != nil { + return nil, err + } + return txReceipt(receipt), nil +} + +func (ts *transactorServer) Call(ctx context.Context, param *pbtransactor.CallParam) (*pbtransactor.CallResult, error) { + fromAddress, err := crypto.AddressFromBytes(param.GetFrom()) + if err != nil { + return nil, err + } + address, err := crypto.AddressFromBytes(param.GetAddress()) + if err != nil { + return nil, err + } + call, err := ts.transactor.Call(ts.reader, fromAddress, address, param.GetData()) + return &pbtransactor.CallResult{ + Return: call.Return, + GasUsed: call.GasUsed, + }, nil +} + +func (ts *transactorServer) CallCode(ctx context.Context, param *pbtransactor.CallCodeParam) (*pbtransactor.CallResult, error) { + fromAddress, err := crypto.AddressFromBytes(param.GetFrom()) + if err != nil { + return nil, err + } + call, err := ts.transactor.CallCode(ts.reader, fromAddress, param.GetCode(), param.GetData()) + return &pbtransactor.CallResult{ + Return: call.Return, + GasUsed: call.GasUsed, + }, nil +} + +func (ts *transactorServer) Transact(ctx context.Context, param *pbtransactor.TransactParam) (*pbtransactor.TxReceipt, error) { + inputAccount, err := ts.inputAccount(param.GetInputAccount()) + if err != nil { + return nil, err + } + address, err := crypto.MaybeAddressFromBytes(param.GetAddress()) + if err != nil { + return nil, err + } + receipt, err := ts.transactor.Transact(inputAccount, address, param.GetData(), param.GetGasLimit(), + param.GetFee()) + if err != nil { + return nil, err + } + return txReceipt(receipt), nil +} + +func (ts *transactorServer) TransactAndHold(ctx context.Context, param *pbtransactor.TransactParam) (*pbevents.EventDataCall, error) { + inputAccount, err := ts.inputAccount(param.GetInputAccount()) + if err != nil { + return nil, err + } + address, err := crypto.MaybeAddressFromBytes(param.GetAddress()) + if err != nil { + return nil, err + } + edt, err := ts.transactor.TransactAndHold(ctx, inputAccount, address, param.GetData(), + param.GetGasLimit(), param.GetFee()) + if err != nil { + return nil, err + } + return pbevents.GetEventDataCall(edt), nil +} + +func (ts *transactorServer) Send(ctx context.Context, param *pbtransactor.SendParam) (*pbtransactor.TxReceipt, error) { + inputAccount, err := ts.inputAccount(param.GetInputAccount()) + if err != nil { + return nil, err + } + toAddress, err := crypto.AddressFromBytes(param.GetToAddress()) + if err != nil { + return nil, err + } + receipt, err := ts.transactor.Send(inputAccount, toAddress, param.GetAmount()) + if err != nil { + return nil, err + } + return txReceipt(receipt), nil +} + +func (ts *transactorServer) SendAndHold(ctx context.Context, param *pbtransactor.SendParam) (*pbtransactor.TxReceipt, error) { + inputAccount, err := ts.inputAccount(param.GetInputAccount()) + if err != nil { + return nil, err + } + toAddress, err := crypto.AddressFromBytes(param.GetToAddress()) + if err != nil { + return nil, err + } + receipt, err := ts.transactor.SendAndHold(ctx, inputAccount, toAddress, param.GetAmount()) + if err != nil { + return nil, err + } + return txReceipt(receipt), nil +} + +func (ts *transactorServer) SignTx(ctx context.Context, param *pbtransactor.SignTxParam) (*pbtransactor.SignedTx, error) { + txEnv, err := ts.txCodec.DecodeTx(param.GetTx()) + if err != nil { + return nil, err + } + signers, err := signersFromPrivateAccounts(param.GetPrivateAccounts()) + if err != nil { + return nil, err + } + txEnvSigned, err := ts.transactor.SignTx(txEnv, signers) + if err != nil { + return nil, err + } + bs, err := ts.txCodec.EncodeTx(txEnvSigned) + if err != nil { + return nil, err + } + return &pbtransactor.SignedTx{ + Tx: bs, + }, nil +} + +func (ts *transactorServer) inputAccount(inAcc *pbtransactor.InputAccount) (*execution.SequentialSigningAccount, error) { + return ts.accounts.GetSequentialSigningAccount(inAcc.GetAddress(), inAcc.GetPrivateKey()) +} + +func txReceipt(receipt *txs.Receipt) *pbtransactor.TxReceipt { + return &pbtransactor.TxReceipt{ + ContractAddress: receipt.ContractAddress.Bytes(), + CreatesContract: receipt.CreatesContract, + TxHash: receipt.TxHash, + } +} + +func signersFromPrivateAccounts(privateAccounts []*pbtransactor.PrivateAccount) ([]acm.AddressableSigner, error) { + signers := make([]acm.AddressableSigner, len(privateAccounts)) + var err error + for i, pa := range privateAccounts { + signers[i], err = privateAccount(pa) + if err != nil { + return nil, err + } + } + return signers, nil +} + +func privateAccount(privateAccount *pbtransactor.PrivateAccount) (acm.PrivateAccount, error) { + privateKey, err := crypto.PrivateKeyFromRawBytes(privateAccount.PrivateKey, crypto.CurveTypeEd25519) + if err != nil { + return nil, err + } + publicKey := privateKey.GetPublicKey() + return acm.ConcretePrivateAccount{ + Address: publicKey.Address(), + PrivateKey: privateKey, + PublicKey: publicKey, + }.PrivateAccount(), nil +} diff --git a/rpc/service.go b/rpc/service.go index ecf7b3bc4e3d8171755922e66cd6ad65844b714b..dab10524d4d88570b4e7eaa365f5bea2232b4a1f 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -419,19 +419,3 @@ func (s *Service) GeneratePrivateAccount() (*ResultGeneratePrivateAccount, error PrivateAccount: acm.AsConcretePrivateAccount(privateAccount), }, nil } - -// Gets signing account from onr of private key or address - failing if both are provided -func (s *Service) SigningAccount(address, privateKey []byte) (*execution.SequentialSigningAccount, error) { - if len(address) > 0 { - if len(privateKey) > 0 { - return nil, fmt.Errorf("privKey and address provided but only one or the other should be given") - } - address, err := crypto.AddressFromBytes(address) - if err != nil { - return nil, err - } - return s.MempoolAccounts().SequentialSigningAccount(address) - } - - return s.mempoolAccounts.SequentialSigningAccountFromPrivateKey(privateKey) -} diff --git a/rpc/v0/subscriptions.go b/rpc/subscriptions.go similarity index 95% rename from rpc/v0/subscriptions.go rename to rpc/subscriptions.go index 74fff345ab2df6d98307bb5fa148b221434ac05f..691df6dde2ff3bf9049fc04a897591e904e38935 100644 --- a/rpc/v0/subscriptions.go +++ b/rpc/subscriptions.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v0 +package rpc import ( "context" @@ -21,7 +21,6 @@ import ( "time" "github.com/hyperledger/burrow/event" - "github.com/hyperledger/burrow/rpc" ) var ( @@ -32,7 +31,7 @@ var ( // Catches events that callers subscribe to and adds them to an array ready to be polled. type Subscriptions struct { mtx *sync.RWMutex - service *rpc.Service + service *Service subs map[string]*SubscriptionsCache reap bool } @@ -44,7 +43,7 @@ type SubscriptionsCache struct { subId string } -func NewSubscriptions(service *rpc.Service) *Subscriptions { +func NewSubscriptions(service *Service) *Subscriptions { es := &Subscriptions{ mtx: &sync.RWMutex{}, service: service, @@ -106,7 +105,7 @@ func (subs *Subscriptions) Add(eventId string) (string, error) { return "", err } cache := newSubscriptionsCache() - err = subs.service.Subscribe(context.Background(), subId, eventId, func(resultEvent *rpc.ResultEvent) bool { + err = subs.service.Subscribe(context.Background(), subId, eventId, func(resultEvent *ResultEvent) bool { cache.mtx.Lock() defer cache.mtx.Unlock() cache.events = append(cache.events, resultEvent) diff --git a/rpc/v0/subscriptions_test.go b/rpc/subscriptions_test.go similarity index 92% rename from rpc/v0/subscriptions_test.go rename to rpc/subscriptions_test.go index 96be266f7032972ec8b266c262c850284929506b..fa67f6cf706636ccfd40b0abfb9f6b468a00c02a 100644 --- a/rpc/v0/subscriptions_test.go +++ b/rpc/subscriptions_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v0 +package rpc import ( "encoding/hex" @@ -22,7 +22,6 @@ import ( "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/logging" - "github.com/hyperledger/burrow/rpc" "github.com/stretchr/testify/assert" ) @@ -35,7 +34,7 @@ func TestSubReaping(t *testing.T) { reaperPeriod = 100 * time.Millisecond mee := event.NewEmitter(logging.NewNoopLogger()) - eSubs := NewSubscriptions(rpc.NewSubscribableService(mee, logging.NewNoopLogger())) + eSubs := NewSubscriptions(NewSubscribableService(mee, logging.NewNoopLogger())) doneChan := make(chan error) go func() { for i := 0; i < NUM_SUBS; i++ { @@ -79,7 +78,7 @@ func TestSubManualClose(t *testing.T) { reaperPeriod = 10000 * time.Millisecond mee := event.NewEmitter(logging.NewNoopLogger()) - eSubs := NewSubscriptions(rpc.NewSubscribableService(mee, logging.NewNoopLogger())) + eSubs := NewSubscriptions(NewSubscribableService(mee, logging.NewNoopLogger())) doneChan := make(chan error) go func() { for i := 0; i < NUM_SUBS; i++ { @@ -127,7 +126,7 @@ func TestSubFlooding(t *testing.T) { // Crank it up. Now pressure is 10 times higher on each sub. mockInterval = 1 * time.Millisecond mee := event.NewEmitter(logging.NewNoopLogger()) - eSubs := NewSubscriptions(rpc.NewSubscribableService(mee, logging.NewNoopLogger())) + eSubs := NewSubscriptions(NewSubscribableService(mee, logging.NewNoopLogger())) doneChan := make(chan error) go func() { for i := 0; i < NUM_SUBS; i++ { diff --git a/rpc/tm/integration/client_test.go b/rpc/tm/integration/client_test.go index 260cb82926a763d7ef00466e8352bf1c608589dc..b30a66ec13da1107732b75f8d97337f858827e90 100644 --- a/rpc/tm/integration/client_test.go +++ b/rpc/tm/integration/client_test.go @@ -200,7 +200,7 @@ func TestNameReg(t *testing.T) { }, func(eventID string, resultEvent *rpc.ResultEvent) (bool, error) { - eventDataTx := resultEvent.EventDataTx + eventDataTx := resultEvent.Execution.GetTx() assert.NotNil(t, eventDataTx, "could not convert %s to EventDataTx", resultEvent) tx, ok := eventDataTx.Tx.Payload.(*payload.NameTx) if !ok { diff --git a/rpc/tm/integration/websocket_client_test.go b/rpc/tm/integration/websocket_client_test.go index 19ab475388e08153cc6049692e550519c25aadac..2c996ac1ec956a4745d80e535117a2b572334a89 100644 --- a/rpc/tm/integration/websocket_client_test.go +++ b/rpc/tm/integration/websocket_client_test.go @@ -24,15 +24,14 @@ import ( "time" "github.com/hyperledger/burrow/crypto" - exe_events "github.com/hyperledger/burrow/execution/events" - evm_events "github.com/hyperledger/burrow/execution/evm/events" + "github.com/hyperledger/burrow/execution/events" "github.com/hyperledger/burrow/rpc" - tm_client "github.com/hyperledger/burrow/rpc/tm/client" + tmClient "github.com/hyperledger/burrow/rpc/tm/client" "github.com/hyperledger/burrow/txs" "github.com/hyperledger/burrow/txs/payload" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - tm_types "github.com/tendermint/tendermint/types" + tmTypes "github.com/tendermint/tendermint/types" ) //-------------------------------------------------------------------------------- @@ -47,7 +46,7 @@ func TestWSConnect(t *testing.T) { // receive a new block message func TestWSNewBlock(t *testing.T) { wsc := newWSClient() - eid := tm_types.EventNewBlock + eid := tmTypes.EventNewBlock subId := subscribeAndGetSubscriptionId(t, wsc, eid) defer func() { unsubscribe(t, wsc, subId) @@ -66,7 +65,7 @@ func TestWSBlockchainGrowth(t *testing.T) { t.Skip("skipping test in short mode.") } wsc := newWSClient() - eid := tm_types.EventNewBlock + eid := tmTypes.EventNewBlock subId := subscribeAndGetSubscriptionId(t, wsc, eid) defer func() { unsubscribe(t, wsc, subId) @@ -100,8 +99,8 @@ func TestWSSend(t *testing.T) { wsc := newWSClient() toAddr := privateAccounts[1].Address() amt := uint64(100) - eidInput := exe_events.EventStringAccountInput(privateAccounts[0].Address()) - eidOutput := exe_events.EventStringAccountOutput(toAddr) + eidInput := events.EventStringAccountInput(privateAccounts[0].Address()) + eidOutput := events.EventStringAccountOutput(toAddr) subIdInput := subscribeAndGetSubscriptionId(t, wsc, eidInput) subIdOutput := subscribeAndGetSubscriptionId(t, wsc, eidOutput) defer func() { @@ -114,7 +113,7 @@ func TestWSSend(t *testing.T) { broadcastTx(t, jsonRpcClient, tx) // Set of response IDs we expect - rids := map[string]struct{}{tm_client.EventResponseID(eidInput): {}, tm_client.EventResponseID(eidOutput): {}} + rids := map[string]struct{}{tmClient.EventResponseID(eidInput): {}, tmClient.EventResponseID(eidOutput): {}} r := <-wsc.ResponsesCh result, err := readResponse(r) @@ -138,7 +137,7 @@ func TestWSDoubleFire(t *testing.T) { t.Skip("skipping test in short mode.") } wsc := newWSClient() - eid := exe_events.EventStringAccountInput(privateAccounts[0].Address()) + eid := events.EventStringAccountInput(privateAccounts[0].Address()) subId := subscribeAndGetSubscriptionId(t, wsc, eid) defer func() { unsubscribe(t, wsc, subId) @@ -173,7 +172,7 @@ func TestWSCallWait(t *testing.T) { amt, gasLim, fee := uint64(10000), uint64(1000), uint64(1000) code, returnCode, returnVal := simpleContract() var contractAddr crypto.Address - eid1 := exe_events.EventStringAccountInput(privateAccounts[0].Address()) + eid1 := events.EventStringAccountInput(privateAccounts[0].Address()) subId1 := subscribeAndGetSubscriptionId(t, wsc, eid1) // wait for the contract to be created waitForEvent(t, wsc, eid1, func() { @@ -186,7 +185,7 @@ func TestWSCallWait(t *testing.T) { // susbscribe to the new contract amt = uint64(10001) - eid2 := exe_events.EventStringAccountOutput(contractAddr) + eid2 := events.EventStringAccountOutput(contractAddr) subId2 := subscribeAndGetSubscriptionId(t, wsc, eid2) // get the return value from a call data := []byte{0x1} @@ -217,7 +216,7 @@ func TestWSCallNoWait(t *testing.T) { // susbscribe to the new contract amt = uint64(10001) - eid := exe_events.EventStringAccountOutput(contractAddr) + eid := events.EventStringAccountOutput(contractAddr) subId := subscribeAndGetSubscriptionId(t, wsc, eid) defer unsubscribe(t, wsc, subId) @@ -247,7 +246,7 @@ func TestWSCallCall(t *testing.T) { receipt := txEnv.Tx.GenerateReceipt() contractAddr1 := receipt.ContractAddress // subscribe to the new contracts - eid := evm_events.EventStringAccountCall(contractAddr1) + eid := events.EventStringAccountCall(contractAddr1) subId := subscribeAndGetSubscriptionId(t, wsc, eid) defer unsubscribe(t, wsc, subId) @@ -285,7 +284,7 @@ func TestWSCallCall(t *testing.T) { func TestSubscribe(t *testing.T) { wsc := newWSClient() var subId string - subscribe(t, wsc, tm_types.EventNewBlock) + subscribe(t, wsc, tmTypes.EventNewBlock) Subscribe: for { @@ -297,7 +296,7 @@ Subscribe: require.Nil(t, response.Error) res := new(rpc.ResultSubscribe) require.NoError(t, json.Unmarshal(response.Result, res)) - assert.Equal(t, tm_types.EventNewBlock, res.EventID) + assert.Equal(t, tmTypes.EventNewBlock, res.EventID) subId = res.SubscriptionID break Subscribe } @@ -317,7 +316,7 @@ Subscribe: case response := <-wsc.ResponsesCh: require.Nil(t, response.Error) - if response.ID == tm_client.EventResponseID(tm_types.EventNewBlock) { + if response.ID == tmClient.EventResponseID(tmTypes.EventNewBlock) { res := new(rpc.ResultEvent) json.Unmarshal(response.Result, res) enb := res.Tendermint.EventDataNewBlock() diff --git a/rpc/tm/integration/websocket_helpers.go b/rpc/tm/integration/websocket_helpers.go index 785c9fd3afb2126eaf29741d09b2349e0c1bf9cc..bd00cf7a115253742afa92b1cb180239d4d070c2 100644 --- a/rpc/tm/integration/websocket_helpers.go +++ b/rpc/tm/integration/websocket_helpers.go @@ -250,7 +250,7 @@ func readResponse(r rpcTypes.RPCResponse) (*rpc.ResultEvent, error) { //-------------------------------------------------------------------------------- func unmarshalValidateSend(amt uint64, toAddr crypto.Address, resultEvent *rpc.ResultEvent) error { - data := resultEvent.EventDataTx + data := resultEvent.Execution.GetTx() if data == nil { return fmt.Errorf("event data %v is not EventDataTx", resultEvent) } @@ -274,7 +274,7 @@ func unmarshalValidateSend(amt uint64, toAddr crypto.Address, resultEvent *rpc.R func unmarshalValidateTx(amt uint64, returnCode []byte) resultEventChecker { return func(eventID string, resultEvent *rpc.ResultEvent) (bool, error) { - data := resultEvent.EventDataTx + data := resultEvent.Execution.GetTx() if data == nil { return true, fmt.Errorf("event data %v is not EventDataTx", *resultEvent) } @@ -300,7 +300,7 @@ func unmarshalValidateTx(amt uint64, returnCode []byte) resultEventChecker { func unmarshalValidateCall(origin crypto.Address, returnCode []byte, txid *[]byte) resultEventChecker { return func(eventID string, resultEvent *rpc.ResultEvent) (bool, error) { - data := resultEvent.EventDataCall + data := resultEvent.Execution.Call if data == nil { return true, fmt.Errorf("event data %v is not EventDataTx", *resultEvent) } diff --git a/rpc/v0/client.go b/rpc/v0/client.go index 5bf27c5ff14a27fd8da0456f96f5a6f8879980a2..f663a7993509daf900b8f1d4a4c7e25a4662783d 100644 --- a/rpc/v0/client.go +++ b/rpc/v0/client.go @@ -8,7 +8,7 @@ import ( "time" "github.com/hyperledger/burrow/execution" - "github.com/hyperledger/burrow/execution/evm/events" + "github.com/hyperledger/burrow/execution/events" "github.com/hyperledger/burrow/rpc" "github.com/hyperledger/burrow/txs" ) diff --git a/rpc/v0/integration/v0_test.go b/rpc/v0/integration/v0_test.go index 55590ff15dde438b381f5f5ff2e203388e4257de..5b280a759d4c0069d4d25a93575c9b1b8a002302 100644 --- a/rpc/v0/integration/v0_test.go +++ b/rpc/v0/integration/v0_test.go @@ -124,7 +124,7 @@ func TestTransactAndHold(t *testing.T) { GasLimit: 10000, }) require.NoError(t, err) - assert.Equal(t, 0, create.StackDepth) + assert.Equal(t, uint64(0), create.StackDepth) functionID := abi.FunctionID("UpsieDownsie()") call, err := cli.TransactAndHold(v0.TransactParam{ InputAccount: inputAccount(i), diff --git a/rpc/v0/json_service.go b/rpc/v0/json_service.go index 08459b7049a497636c9c96b819d9b618ae424927..bb4facea92691dd0acc07499673a955f310bf7dd 100644 --- a/rpc/v0/json_service.go +++ b/rpc/v0/json_service.go @@ -81,7 +81,7 @@ func (jrs *JsonRpcServer) handleFunc(c *gin.Context) { type JSONService struct { codec rpc.Codec service *rpc.Service - eventSubs *Subscriptions + eventSubs *rpc.Subscriptions defaultHandlers map[string]RequestHandlerFunc logger *logging.Logger } @@ -92,7 +92,7 @@ func NewJSONService(codec rpc.Codec, service *rpc.Service, logger *logging.Logge tmhttps := &JSONService{ codec: codec, service: service, - eventSubs: NewSubscriptions(service), + eventSubs: rpc.NewSubscriptions(service), logger: logger.WithScope("NewJSONService"), } diff --git a/rpc/v0/methods.go b/rpc/v0/methods.go index 536a554f3614170b14cf91a18ad8a1763070cc15..224ce798ddc71357f2bda08322e03279ce712d9e 100644 --- a/rpc/v0/methods.go +++ b/rpc/v0/methods.go @@ -233,7 +233,8 @@ func GetMethods(codec rpc.Codec, service *rpc.Service, logger *logging.Logger) m return nil, rpc.INVALID_PARAMS, err } // Use mempool state so that transact can generate a run of sequence numbers when formulating transactions - inputAccount, err := service.SigningAccount(param.InputAccount.Address, param.InputAccount.PrivateKey) + inputAccount, err := service.MempoolAccounts().GetSequentialSigningAccount(param.InputAccount.Address, + param.InputAccount.PrivateKey) if err != nil { return nil, rpc.INVALID_PARAMS, err } @@ -253,7 +254,8 @@ func GetMethods(codec rpc.Codec, service *rpc.Service, logger *logging.Logger) m if err != nil { return nil, rpc.INVALID_PARAMS, err } - inputAccount, err := service.SigningAccount(param.InputAccount.Address, param.InputAccount.PrivateKey) + inputAccount, err := service.MempoolAccounts().GetSequentialSigningAccount(param.InputAccount.Address, + param.InputAccount.PrivateKey) if err != nil { return nil, rpc.INVALID_PARAMS, err } @@ -275,7 +277,8 @@ func GetMethods(codec rpc.Codec, service *rpc.Service, logger *logging.Logger) m return nil, rpc.INVALID_PARAMS, err } // Run Send against mempool state - inputAccount, err := service.SigningAccount(param.InputAccount.Address, param.InputAccount.PrivateKey) + inputAccount, err := service.MempoolAccounts().GetSequentialSigningAccount(param.InputAccount.Address, + param.InputAccount.PrivateKey) if err != nil { return nil, rpc.INVALID_PARAMS, err } @@ -296,7 +299,8 @@ func GetMethods(codec rpc.Codec, service *rpc.Service, logger *logging.Logger) m return nil, rpc.INVALID_PARAMS, err } // Run Send against mempool state - inputAccount, err := service.SigningAccount(param.InputAccount.Address, param.InputAccount.PrivateKey) + inputAccount, err := service.MempoolAccounts().GetSequentialSigningAccount(param.InputAccount.Address, + param.InputAccount.PrivateKey) if err != nil { return nil, rpc.INVALID_PARAMS, err } @@ -312,7 +316,8 @@ func GetMethods(codec rpc.Codec, service *rpc.Service, logger *logging.Logger) m if err != nil { return nil, rpc.INVALID_PARAMS, err } - inputAccount, err := service.SigningAccount(param.InputAccount.Address, param.InputAccount.PrivateKey) + inputAccount, err := service.MempoolAccounts().GetSequentialSigningAccount(param.InputAccount.Address, + param.InputAccount.PrivateKey) if err != nil { return nil, rpc.INVALID_PARAMS, err }