From dbfe3c61202906f968a37d0eb000fa5b6fd241d8 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Fri, 5 Feb 2021 11:01:00 +0000 Subject: [PATCH] Add wasm printMem and other debug functions Signed-off-by: Sean Young --- deploy/jobs/jobs_contracts.go | 13 +- deploy/jobs/jobs_test_jobs.go | 2 + execution/exec/event.go | 1 + execution/exec/event_sink.go | 5 + execution/exec/events.go | 11 + execution/exec/exec.pb.go | 459 ++++++++++++++++++++----- execution/exec/stream_event.go | 2 + execution/exec/tx_execution.go | 8 + execution/solidity/ewasm.solang | 4 + execution/solidity/ewasm.solang.go | 4 +- execution/wasm/contract.go | 136 ++++++++ execution/wasm/storage_test.solang.go | 2 +- go.mod | 1 + go.sum | 2 + integration/rpctransact/call_test.go | 27 ++ js/proto/exec_pb.d.ts | 36 ++ js/proto/exec_pb.js | 283 ++++++++++++++- keys/keys_grpc.pb.go | 8 +- protobuf/exec.proto | 6 + rpc/rpcdump/rpcdump_grpc.pb.go | 10 +- rpc/rpcevents/rpcevents_grpc.pb.go | 12 +- rpc/rpcquery/rpcquery_grpc.pb.go | 14 +- rpc/rpctransact/rpctransact_grpc.pb.go | 8 +- 23 files changed, 944 insertions(+), 110 deletions(-) diff --git a/deploy/jobs/jobs_contracts.go b/deploy/jobs/jobs_contracts.go index 2916f7818..ae1d6a72d 100644 --- a/deploy/jobs/jobs_contracts.go +++ b/deploy/jobs/jobs_contracts.go @@ -574,14 +574,17 @@ func deployFinalize(client *def.Client, tx payload.Payload, logger *logging.Logg } func logEvents(txe *exec.TxExecution, client *def.Client, logger *logging.Logger) { - if client.AllSpecs == nil { - return - } - for _, event := range txe.Events { + print := event.GetPrint() + + if print != nil { + logger.InfoMsg("print", "address", print.Address.String(), "msg", string(print.Data)) + continue + } + eventLog := event.GetLog() - if eventLog == nil { + if eventLog == nil || client.AllSpecs == nil { continue } diff --git a/deploy/jobs/jobs_test_jobs.go b/deploy/jobs/jobs_test_jobs.go index 6f44c3656..33ead2c65 100644 --- a/deploy/jobs/jobs_test_jobs.go +++ b/deploy/jobs/jobs_test_jobs.go @@ -69,6 +69,8 @@ func QueryContractJob(query *def.QueryContract, do *def.DeployArgs, script *def. return "", nil, err } + logEvents(txe, client, logger) + result2 := util.GetReturnValue(query.Variables, logger) // Finalize if result2 != "" { diff --git a/execution/exec/event.go b/execution/exec/event.go index 824e45dec..82687f75a 100644 --- a/execution/exec/event.go +++ b/execution/exec/event.go @@ -24,6 +24,7 @@ const ( TypeEnvelope TypeEndTx TypeEndBlock + TypePrint ) var nameFromType = map[EventType]string{ diff --git a/execution/exec/event_sink.go b/execution/exec/event_sink.go index 194573797..ef5e4bde9 100644 --- a/execution/exec/event_sink.go +++ b/execution/exec/event_sink.go @@ -7,6 +7,7 @@ import ( type EventSink interface { Call(call *CallEvent, exception *errors.Exception) error Log(log *LogEvent) error + Print(print *PrintEvent) error } type noopEventSink struct { @@ -24,6 +25,10 @@ func (es *noopEventSink) Log(log *LogEvent) error { return nil } +func (es *noopEventSink) Print(print *PrintEvent) error { + return nil +} + type logFreeEventSink struct { EventSink } diff --git a/execution/exec/events.go b/execution/exec/events.go index 5961e4137..3f396aa3a 100644 --- a/execution/exec/events.go +++ b/execution/exec/events.go @@ -44,6 +44,17 @@ func (evs *Events) Log(log *LogEvent) error { return nil } +func (evs *Events) Print(print *PrintEvent) error { + evs.Append(&Event{ + Header: &Header{ + EventType: TypePrint, + EventID: EventStringLogEvent(print.Address), + }, + Print: print, + }) + return nil +} + func (evs Events) CallTrace() string { var calls []string for _, ev := range evs { diff --git a/execution/exec/exec.pb.go b/execution/exec/exec.pb.go index fc390f79d..a28c5e588 100644 --- a/execution/exec/exec.pb.go +++ b/execution/exec/exec.pb.go @@ -874,6 +874,7 @@ type Event struct { Call *CallEvent `protobuf:"bytes,4,opt,name=Call,proto3" json:"Call,omitempty"` Log *LogEvent `protobuf:"bytes,5,opt,name=Log,proto3" json:"Log,omitempty"` GovernAccount *GovernAccountEvent `protobuf:"bytes,6,opt,name=GovernAccount,proto3" json:"GovernAccount,omitempty"` + Print *PrintEvent `protobuf:"bytes,7,opt,name=Print,proto3" json:"Print,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -949,6 +950,13 @@ func (m *Event) GetGovernAccount() *GovernAccountEvent { return nil } +func (m *Event) GetPrint() *PrintEvent { + if m != nil { + return m.Print + } + return nil +} + func (*Event) XXX_MessageName() string { return "exec.Event" } @@ -1136,6 +1144,47 @@ func (*CallEvent) XXX_MessageName() string { return "exec.CallEvent" } +type PrintEvent struct { + Address github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"` + Data github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,2,opt,name=Data,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"Data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PrintEvent) Reset() { *m = PrintEvent{} } +func (m *PrintEvent) String() string { return proto.CompactTextString(m) } +func (*PrintEvent) ProtoMessage() {} +func (*PrintEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_4d737c7315c25422, []int{16} +} +func (m *PrintEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrintEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *PrintEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrintEvent.Merge(m, src) +} +func (m *PrintEvent) XXX_Size() int { + return m.Size() +} +func (m *PrintEvent) XXX_DiscardUnknown() { + xxx_messageInfo_PrintEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_PrintEvent proto.InternalMessageInfo + +func (*PrintEvent) XXX_MessageName() string { + return "exec.PrintEvent" +} + type GovernAccountEvent struct { AccountUpdate *spec.TemplateAccount `protobuf:"bytes,1,opt,name=AccountUpdate,proto3" json:"AccountUpdate,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -1147,7 +1196,7 @@ func (m *GovernAccountEvent) Reset() { *m = GovernAccountEvent{} } func (m *GovernAccountEvent) String() string { return proto.CompactTextString(m) } func (*GovernAccountEvent) ProtoMessage() {} func (*GovernAccountEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_4d737c7315c25422, []int{16} + return fileDescriptor_4d737c7315c25422, []int{17} } func (m *GovernAccountEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1194,7 +1243,7 @@ func (m *InputEvent) Reset() { *m = InputEvent{} } func (m *InputEvent) String() string { return proto.CompactTextString(m) } func (*InputEvent) ProtoMessage() {} func (*InputEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_4d737c7315c25422, []int{17} + return fileDescriptor_4d737c7315c25422, []int{18} } func (m *InputEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1234,7 +1283,7 @@ func (m *OutputEvent) Reset() { *m = OutputEvent{} } func (m *OutputEvent) String() string { return proto.CompactTextString(m) } func (*OutputEvent) ProtoMessage() {} func (*OutputEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_4d737c7315c25422, []int{18} + return fileDescriptor_4d737c7315c25422, []int{19} } func (m *OutputEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1279,7 +1328,7 @@ 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_4d737c7315c25422, []int{19} + return fileDescriptor_4d737c7315c25422, []int{20} } func (m *CallData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1354,6 +1403,8 @@ func init() { golang_proto.RegisterType((*LogEvent)(nil), "exec.LogEvent") proto.RegisterType((*CallEvent)(nil), "exec.CallEvent") golang_proto.RegisterType((*CallEvent)(nil), "exec.CallEvent") + proto.RegisterType((*PrintEvent)(nil), "exec.PrintEvent") + golang_proto.RegisterType((*PrintEvent)(nil), "exec.PrintEvent") proto.RegisterType((*GovernAccountEvent)(nil), "exec.GovernAccountEvent") golang_proto.RegisterType((*GovernAccountEvent)(nil), "exec.GovernAccountEvent") proto.RegisterType((*InputEvent)(nil), "exec.InputEvent") @@ -1368,90 +1419,91 @@ func init() { proto.RegisterFile("exec.proto", fileDescriptor_4d737c7315c25422) func init() { golang_proto.RegisterFile("exec.proto", fileDescriptor_4d737c7315c25422) } var fileDescriptor_4d737c7315c25422 = []byte{ - // 1314 bytes of a gzipped FileDescriptorProto + // 1340 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, 0x17, 0xef, 0xda, 0x6b, 0xc7, 0x7e, 0x76, 0xfa, 0x6d, 0x47, 0xf9, 0x22, 0xab, 0xaa, 0xec, 0xb2, 0x45, 0xa5, 0x94, 0xb2, 0xae, 0x02, 0x45, 0xa8, 0x48, 0x88, 0xba, 0x09, 0x6d, 0xa0, 0xa4, 0x65, - 0xea, 0x16, 0x81, 0xe0, 0xb0, 0xf1, 0x4e, 0x37, 0xab, 0xda, 0xbb, 0xab, 0xdd, 0xd9, 0xb2, 0xfe, - 0x17, 0x38, 0xc1, 0xad, 0x48, 0x08, 0xf5, 0xcc, 0xbf, 0xc0, 0x01, 0x8e, 0xb9, 0xd1, 0x23, 0xea, - 0xc1, 0xa0, 0xf4, 0x2f, 0x40, 0x9c, 0xe8, 0x09, 0xcd, 0xcc, 0x9b, 0xf5, 0x2e, 0x49, 0x93, 0x8a, - 0x04, 0x89, 0x4b, 0x34, 0xef, 0xbd, 0xcf, 0x3e, 0xbf, 0x1f, 0x9f, 0xf7, 0x66, 0x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, 0xac, 0x77, 0xce, 0xf3, 0xf9, 0x66, 0xba, 0x61, 0x8f, 0xc2, 0x49, 0x7f, - 0x73, 0x1a, 0xb1, 0x78, 0xcc, 0x5c, 0x8f, 0xc5, 0xfd, 0x8d, 0x34, 0x8e, 0xc3, 0x2f, 0xfa, 0x45, - 0x3c, 0xcd, 0xdd, 0x91, 0x17, 0xa1, 0x26, 0xc3, 0xef, 0x98, 0xd2, 0x6f, 0x4b, 0x45, 0xa0, 0xf2, - 0x55, 0x16, 0x09, 0x09, 0xdc, 0x61, 0xd6, 0xa9, 0x95, 0x20, 0x42, 0x45, 0x95, 0x85, 0x9c, 0x13, - 0x01, 0xba, 0x2a, 0xf3, 0xba, 0x44, 0x1d, 0xcd, 0x51, 0x2a, 0xef, 0xdc, 0x7e, 0xc9, 0xdc, 0x7a, - 0xd8, 0x33, 0xac, 0x6f, 0x8d, 0x62, 0xb9, 0xc8, 0x0b, 0x50, 0xbf, 0xc6, 0x7c, 0x6f, 0x93, 0xcb, - 0xc2, 0x99, 0x14, 0x25, 0xa1, 0x5f, 0x4f, 0x27, 0xc3, 0x2c, 0x91, 0x79, 0x9b, 0x14, 0x25, 0x72, - 0x1e, 0x8e, 0xdf, 0x8c, 0x99, 0xcb, 0x46, 0x2c, 0x49, 0xc2, 0x18, 0x3f, 0x35, 0x25, 0x64, 0xa7, - 0x81, 0x5c, 0x10, 0xde, 0x1d, 0x97, 0xc5, 0x58, 0xe7, 0x8e, 0x3d, 0x67, 0xa1, 0xad, 0xf8, 0xa7, - 0xec, 0x14, 0x71, 0x96, 0x35, 0x4f, 0xe8, 0x59, 0xb1, 0x59, 0xdf, 0x1b, 0x79, 0xff, 0x44, 0x01, - 0x86, 0x19, 0xfe, 0x86, 0x51, 0x2c, 0x80, 0xd6, 0xd2, 0xdc, 0x4e, 0x4e, 0x42, 0x73, 0x3d, 0xd5, - 0x64, 0xab, 0x49, 0x97, 0x73, 0x05, 0x79, 0x09, 0xea, 0x94, 0x25, 0xe9, 0x98, 0x63, 0xac, 0x6d, - 0xe5, 0x47, 0xe9, 0x28, 0xda, 0x48, 0x1f, 0x9a, 0xab, 0xd9, 0x88, 0x45, 0xdc, 0x0f, 0x03, 0x6c, - 0xdd, 0x71, 0x1b, 0x67, 0x23, 0x37, 0xd0, 0x39, 0xc6, 0xba, 0x83, 0x4d, 0x24, 0x1f, 0x42, 0x7d, - 0x98, 0x5d, 0x73, 0x92, 0x4d, 0x59, 0xd1, 0xf6, 0xe0, 0xe2, 0xd6, 0xac, 0x77, 0xe4, 0xf1, 0xac, - 0xf7, 0xda, 0xde, 0xf4, 0xd9, 0xf0, 0x03, 0x27, 0x9e, 0xda, 0xd7, 0x58, 0x36, 0x98, 0x72, 0x96, - 0x50, 0x74, 0x62, 0xfd, 0x69, 0xcc, 0x33, 0x27, 0xef, 0x0b, 0xdf, 0xc3, 0x69, 0xc4, 0x64, 0x0d, - 0x16, 0x07, 0xcb, 0x4f, 0x67, 0x3d, 0x7b, 0x5f, 0x5a, 0xf6, 0x23, 0x67, 0x3a, 0x0e, 0x1d, 0xd7, - 0x16, 0x5f, 0x52, 0xf4, 0x50, 0x88, 0xb3, 0x72, 0x08, 0x71, 0x16, 0x9a, 0x58, 0x2d, 0x11, 0x6c, - 0x09, 0x6a, 0x6b, 0x81, 0xcb, 0x32, 0x24, 0x8f, 0x12, 0x44, 0x13, 0x6e, 0xc4, 0xbe, 0xe7, 0x07, - 0xc8, 0x79, 0x6c, 0x82, 0xd2, 0x51, 0xb4, 0x59, 0x3f, 0x1a, 0x70, 0x54, 0x52, 0x64, 0x35, 0x63, - 0xa3, 0x54, 0x94, 0xf9, 0x99, 0x3c, 0xfe, 0x97, 0xf9, 0x2a, 0x76, 0xd8, 0x30, 0xcb, 0xc3, 0x10, - 0xd3, 0x52, 0xd8, 0x61, 0x05, 0x0b, 0x2d, 0xc1, 0xac, 0x77, 0xe1, 0x68, 0x41, 0xfe, 0x80, 0x4d, - 0xf7, 0x1a, 0xc4, 0x1b, 0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xb1, 0xa5, 0x61, 0x34, 0x8c, 0x94, + 0xa2, 0x2b, 0x4f, 0xda, 0x76, 0xec, 0xb8, 0x60, 0xa1, 0xcf, 0xf8, 0x38, 0x08, 0x45, 0x57, 0x4c, + 0x63, 0x96, 0xe8, 0xbf, 0x68, 0xed, 0x0c, 0xa3, 0x68, 0x38, 0x62, 0x5d, 0x25, 0x6d, 0x4c, 0x6e, + 0x77, 0x45, 0x30, 0x66, 0x89, 0xf0, 0xc6, 0x31, 0x02, 0x9a, 0x8c, 0xf3, 0x88, 0x1b, 0x78, 0x23, + 0xf4, 0xc6, 0xd9, 0xb7, 0x75, 0x91, 0x9a, 0xe3, 0x91, 0x58, 0xfe, 0x42, 0x92, 0x04, 0x51, 0x88, + 0x1a, 0x48, 0x62, 0x13, 0x9e, 0xb3, 0x0a, 0xcd, 0x1b, 0x82, 0x33, 0x6f, 0xbc, 0x7a, 0x97, 0x85, + 0x22, 0x21, 0xe7, 0x8b, 0x72, 0xcb, 0x3a, 0x51, 0x3e, 0xdd, 0x58, 0x3e, 0xea, 0xaa, 0x8c, 0x72, + 0x16, 0x5a, 0x80, 0x39, 0x3f, 0x96, 0xa0, 0x91, 0x53, 0x90, 0x73, 0x00, 0x3d, 0x36, 0x0c, 0xc2, + 0xde, 0x28, 0x1a, 0xdc, 0x69, 0x59, 0x27, 0xac, 0xd3, 0x8d, 0xe5, 0x23, 0xda, 0xc9, 0x5c, 0x4f, + 0x73, 0x18, 0xf2, 0x32, 0x2c, 0x28, 0xa9, 0x9f, 0xb6, 0x4a, 0x0a, 0xbe, 0x98, 0x83, 0xf7, 0x53, + 0x6a, 0xac, 0xe4, 0x13, 0xa8, 0xad, 0x86, 0x77, 0xd9, 0x28, 0x8a, 0x59, 0xab, 0x8c, 0x48, 0x99, + 0xad, 0x51, 0xf6, 0xdc, 0x87, 0xb3, 0xce, 0x99, 0x61, 0x20, 0x36, 0x27, 0x1b, 0xee, 0x20, 0x1a, + 0x77, 0x37, 0xa7, 0x31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, 0x21, 0xb4, 0x88, 0x75, 0x3e, 0x03, 0x98, 0xef, 0xa9, 0x83, 0xce, 0xdd, 0xf9, 0x1c, + 0x1a, 0xb9, 0xe5, 0x76, 0xe0, 0xee, 0xbf, 0x2e, 0x41, 0x81, 0x83, 0xf2, 0x8c, 0xab, 0xfa, 0x5f, + 0x73, 0x50, 0xfb, 0xc8, 0xbc, 0xb1, 0xfd, 0x31, 0x5a, 0xfb, 0xc8, 0x38, 0x50, 0xde, 0xff, 0x72, + 0x58, 0x82, 0xca, 0x2d, 0x6f, 0x34, 0xd1, 0x0f, 0x85, 0x26, 0xd5, 0x02, 0x39, 0x02, 0xe5, 0xcb, + 0x9e, 0xfe, 0x5f, 0xa6, 0x49, 0xe5, 0xb1, 0xf7, 0xde, 0xd6, 0x76, 0xdb, 0x7a, 0xb0, 0xdd, 0xb6, + 0x7e, 0xdd, 0x6e, 0x5b, 0xbf, 0x6f, 0xb7, 0xad, 0x9f, 0x1f, 0xb5, 0xad, 0xad, 0x47, 0x6d, 0xeb, + 0xd3, 0x3d, 0x52, 0x60, 0xe6, 0x99, 0xa3, 0x4e, 0x1b, 0x55, 0xf5, 0x02, 0x79, 0xfd, 0xef, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x10, 0x3f, 0xdf, 0xac, 0x5f, 0x10, 0x00, 0x00, } func (m *StreamEvents) Marshal() (dAtA []byte, err error) { @@ -2216,6 +2268,18 @@ func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.Print != nil { + { + size, err := m.Print.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.GovernAccount != nil { { size, err := m.GovernAccount.MarshalToSizedBuffer(dAtA[:i]) @@ -2484,6 +2548,53 @@ func (m *CallEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PrintEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PrintEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrintEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + { + size := m.Data.Size() + i -= size + if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Address.Size() + i -= size + if _, err := m.Address.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintExec(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *GovernAccountEvent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3019,6 +3130,10 @@ func (m *Event) Size() (n int) { l = m.GovernAccount.Size() n += 1 + l + sovExec(uint64(l)) } + if m.Print != nil { + l = m.Print.Size() + n += 1 + l + sovExec(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3100,6 +3215,22 @@ func (m *CallEvent) Size() (n int) { return n } +func (m *PrintEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Address.Size() + n += 1 + l + sovExec(uint64(l)) + l = m.Data.Size() + n += 1 + l + sovExec(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *GovernAccountEvent) Size() (n int) { if m == nil { return 0 @@ -3241,6 +3372,9 @@ func (this *Event) GetValue() interface{} { if this.GovernAccount != nil { return this.GovernAccount } + if this.Print != nil { + return this.Print + } return nil } @@ -3258,6 +3392,8 @@ func (this *Event) SetValue(value interface{}) bool { this.Log = vt case *GovernAccountEvent: this.GovernAccount = vt + case *PrintEvent: + this.Print = vt default: return false } @@ -5442,6 +5578,42 @@ func (m *Event) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Print", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthExec + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthExec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Print == nil { + m.Print = &PrintEvent{} + } + if err := m.Print.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipExec(dAtA[iNdEx:]) @@ -5983,6 +6155,123 @@ func (m *CallEvent) Unmarshal(dAtA []byte) error { } return nil } +func (m *PrintEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PrintEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrintEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthExec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthExec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Address.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExec + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthExec + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthExec + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExec(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthExec + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *GovernAccountEvent) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/execution/exec/stream_event.go b/execution/exec/stream_event.go index 79d0f8eb4..05675ca38 100644 --- a/execution/exec/stream_event.go +++ b/execution/exec/stream_event.go @@ -35,6 +35,8 @@ func (ev *StreamEvent) EventType() EventType { return TypeEndTx case ev.EndBlock != nil: return TypeEndBlock + case ev.Event.Print != nil: + return TypePrint } return TypeUnknown } diff --git a/execution/exec/tx_execution.go b/execution/exec/tx_execution.go index b5da6ec35..284266492 100644 --- a/execution/exec/tx_execution.go +++ b/execution/exec/tx_execution.go @@ -128,6 +128,14 @@ func (txe *TxExecution) GovernAccount(governAccount *GovernAccountEvent, excepti }) } +func (txe *TxExecution) Print(print *PrintEvent) error { + txe.Append(&Event{ + Header: txe.Header(TypePrint, EventStringLogEvent(print.Address), nil), + Print: print, + }) + return nil +} + // Errors pushed to TxExecutions end up in merkle state so it is essential that they are deterministic and independent // of the code path taken to execution (e.g. replay takes a different path to that of normal consensus reactor so stack // traces may differ - as they may across architectures) diff --git a/execution/solidity/ewasm.solang b/execution/solidity/ewasm.solang index 1eaf266b7..33ec2f25f 100644 --- a/execution/solidity/ewasm.solang +++ b/execution/solidity/ewasm.solang @@ -48,4 +48,8 @@ contract ewasm is E { function test_events() public { emit L(102, "Hello from wasm", true); } + + function test_print(int64 arg1, string arg2) public { + print("arg1:{} arg2:{}".format(arg1, arg2)); + } } diff --git a/execution/solidity/ewasm.solang.go b/execution/solidity/ewasm.solang.go index 9bc43ef32..5ce8f0932 100644 --- a/execution/solidity/ewasm.solang.go +++ b/execution/solidity/ewasm.solang.go @@ -2,5 +2,5 @@ package solidity import hex "github.com/tmthrgd/go-hex" -var Bytecode_ewasm = hex.MustDecodeString("0061736D01000000011C0660017F006000017F60037F7F7F0060027F7F0060017F017F60000002680508657468657265756D0C67657443616C6C56616C7565000008657468657265756D0B676574436F646553697A65000108657468657265756D08636F6465436F7079000208657468657265756D0666696E697368000308657468657265756D0672657665727400030304030405050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E00070AB40203A60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B5B01027F230041106B220024002000100002402000290300200041086A290300844200520D001006410010014188676A22003602F81441002000100522013602FC14200141F81820001002410041F8141003000B410041001004000B0BFF14010041000BF8140061736D01000000013E0A60017F006000017F60037F7F7F0060027F7F0060077F7F7F7F7F7F7F0060057E7F7F7F7F017F60037F7F7F017F60017F017F60047F7F7F7F017F60000002C6010908657468657265756D0C67657443616C6C56616C7565000008657468657265756D0F67657443616C6C4461746153697A65000108657468657265756D0C63616C6C44617461436F7079000208657468657265756D06726576657274000308657468657265756D036C6F67000408657468657265756D0463616C6C000508657468657265756D1167657452657475726E4461746153697A65000108657468657265756D0E72657475726E44617461436F7079000208657468657265756D0666696E6973680003030B0A020302020206070809090405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E00120AE4110A2E0002402002450D000340200020012D00003A0000200041016A2100200141016A21012002417F6A22020D000B0B0B240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0B2D002000411F6A21000340200120002D00003A0000200141016A21012000417F6A21002002417F6A22020D000B0B2D002001411F6A21010340200120002D00003A00002001417F6A2101200041016A21002002417F6A22020D000B0B29002001417F6A21010340200120026A20002D00003A0000200041016A21002002417F6A22020D000B0B7E01017F200120006C220141086A100F2203200036020420032000360200200341086A2100024002402002417F460D002001450D010340200020022D00003A0000200041016A2100200241016A21022001417F6A22010D000C020B0B2001450D000340200041003A0000200041016A21002001417F6A22010D000B0B20030BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B7F01027F200320016A220441086A100F2205200436020420052004360200200541086A210402402001450D000340200420002D00003A0000200441016A2104200041016A21002001417F6A22010D000B0B02402003450D000340200420022D00003A0000200441016A2104200241016A21022003417F6A22030D000B0B20050B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040BB10C03057F037E017F230041F0016B2200240020002201100002400240024002400240024002400240024002402001290300200141086A290300844200520D00101141001001220236024841002002100F220336024C2003410020021002200241034D0D094100200328020022043602442002417C6A2102200341046A210302400240024002400240024002402004419FBFE9E6054A0D002004419BF9C68004460D04200441A89B8AAA7A460D012004419DB3A4957D470D104100450D0C410041001003000B200441E382B9CC074A0D02200441A0BFE9E605460D04200441EEE98EBF06460D012004419797CBC406460D050C0F0B410F41014100100E2203280200413F6A41607141C0006A2204100F22022004410376100A200141C0003602900120014190016A20024104100C2001200328020022003602B801200141B8016A200241C0006A4104100C200241E0006A200341086A200010092002413F6A41013A00004120100F22034104100A200141E8016A4200370300200142003703E001200142003703D801200142E6003703D001200141D0016A20034120100C200220044102411020034100410010044100450D06410041001003000B200141286A42003703002001420037032020014200370318200142B1A8033703104100450D06410041001003000B200441E482B9CC07470D0C024002400240024020024120490D002003200141306A4118100B200141C0006A3502002105200141306A41086A2903002106200129033021074108100F1A4108100F1A4104100F2202419797CBC406360200200241046A4100100A200142003703C001200142003703B80120012006370398012001200737039001200120053E02A00120014190016A200141D0016A4114100D42FFFFFFFFFFFFFFFFFF00200141D0016A200141B8016A2002410410050D0A1006220241086A100F22032002360200200341046A2002360200200341086A220441002002100720033502002205421F580D0120042001418C016A4104100B200135028C01220742207C22062005560D0220042007A76A200141A8016A4104100B0240200620012802A8012202AD7C2005560D0020014130410D2002410120042006A76A100E220241086A2002280200101036024C4100450D100C040B4102450D0F0C030B200141F0016A240041020F0B41020D010C0D0B4102450D0C0B410041001003000B02400240024020024120490D002003200141D0006A4118100B200141E0006A3502002105200141D0006A41086A2903002106200129035021074104100F220241EEE98EBF06360200200241046A4100100A200142003703B001200142003703A801200120063703C001200120073703B801200120053E02C801200141B8016A20014190016A4114100D42FFFFFFFFFFFFFFFFFF0020014190016A200141A8016A2002410410050D091006220241086A100F22032002360200200341046A2002360200200341086A22044100200210072003280200411F4D0D012004200141D0016A4120100B200141E8006A41186A200141D0016A41186A2903003703002001200141E0016A2903003703782001200141D8016A290300370370200120012903D00137036841000D020C0C0B200141F0016A240041020F0B4102450D0A0B410041001003000B41004100100300000B4108100F1A200141054101413D100E360288014100450D06410041001003000B410041001003000B410041001008000B4120100F22024104100A200141106A20024120100C200241201008000B410041001003000B410041001003000B410041001008000B200128028801280200413F6A41607141206A2203100F22022003410376100A200041706A22042200240020044120360200200420024104100C20012802880122082802002101200041706A22042400200420013602002004200241206A4104100C200241C0006A200841086A20011009200220031008000B4120100F22024104100A200141E8006A20024120100C200241201008000B200128024C280200413F6A41607141206A2203100F22022003410376100A200041706A22042200240020044120360200200420024104100C200128024C22082802002101200041706A22042400200420013602002004200241206A4104100C200241C0006A200841086A20011009200220031008000B410041001003000B0B48010041000B4248656C6C6F2066726F6D207761736D007177213B393C76BAF374B5A91F5A8E4A972270CEFDDA6375DF53FB1A3CAC11C9657761736D2063616C6C656420657761736D") -var Abi_ewasm = []byte(`[{"name":"get_vm","type":"function","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"pure"},{"name":"get_number","type":"function","inputs":[],"outputs":[{"name":"","type":"int256","internalType":"int256"}],"stateMutability":"pure"},{"name":"call_get_vm","type":"function","inputs":[{"name":"e","type":"address","internalType":"contract E"}],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"nonpayable"},{"name":"call_get_number","type":"function","inputs":[{"name":"e","type":"address","internalType":"contract E"}],"outputs":[{"name":"","type":"int256","internalType":"int256"}],"stateMutability":"nonpayable"},{"name":"try_revert","type":"function","inputs":[],"outputs":[],"stateMutability":"pure"},{"name":"hash_tests","type":"function","inputs":[],"outputs":[],"stateMutability":"pure"},{"name":"test_events","type":"function","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"name":"L","type":"event","inputs":[{"name":"f1","type":"int256","internalType":"int256","indexed":true},{"name":"f2","type":"string","internalType":"string"},{"name":"f3","type":"bool","internalType":"bool"}],"outputs":[],"stateMutability":""}]`) +var Bytecode_ewasm = hex.MustDecodeString("0061736D01000000011C0660017F006000017F60037F7F7F0060027F7F0060017F017F60000002680508657468657265756D0C67657443616C6C56616C7565000008657468657265756D0B676574436F646553697A65000108657468657265756D08636F6465436F7079000208657468657265756D0666696E697368000308657468657265756D0672657665727400030304030405050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E00070AB40203A60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B5B01027F230041106B220024002000100002402000290300200041086A290300844200520D0010064100100141F7626A220036028C19410020001005220136029019200141891D2000100241004189191003000B410041001004000B0B9019010041000B89190061736D0100000001440B60017F006000017F60037F7F7F0060077F7F7F7F7F7F7F0060027F7F0060057E7F7F7F7F017F60037F7F7F017F60017F017F60047F7F7F7F017F60000060027F7E017F02D7010A08657468657265756D0C67657443616C6C56616C7565000008657468657265756D0F67657443616C6C4461746153697A65000108657468657265756D0C63616C6C44617461436F7079000208657468657265756D036C6F67000308657468657265756D06726576657274000408657468657265756D0463616C6C000508657468657265756D1167657452657475726E4461746153697A65000108657468657265756D0E72657475726E44617461436F70790002056465627567087072696E744D656D000408657468657265756D0666696E6973680004030C0B0204020202060708090A090405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E00140ACF150B2E0002402002450D000340200020012D00003A0000200041016A2100200141016A21012002417F6A22020D000B0B0B240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0B2D002000411F6A21000340200120002D00003A0000200141016A21012000417F6A21002002417F6A22020D000B0B2D002001411F6A21010340200120002D00003A00002001417F6A2101200041016A21002002417F6A22020D000B0B29002001417F6A21010340200120026A20002D00003A0000200041016A21002002417F6A22020D000B0B7E01017F200120006C220141086A10102203200036020420032000360200200341086A2100024002402002417F460D002001450D010340200020022D00003A0000200041016A2100200241016A21022001417F6A22010D000C020B0B2001450D000340200041003A0000200041016A21002001417F6A22010D000B0B20030BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B7F01027F200320016A220441086A10102205200436020420052004360200200541086A210402402001450D000340200420002D00003A0000200441016A2104200041016A21002001417F6A22010D000B0B02402003450D000340200420022D00003A0000200441016A2104200241016A21022003417F6A22030D000B0B20050B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B8E0103027F017E027F230041206B2102410021030340200220036A20012001420A802204420A7E7DA722053A0000200341016A2103200142095621062004210120060D000B200020054130723A0000200041016A2106024020034101460D002002417E6A210203402006200220036A2D000041306A3A0000200641016A21062003417F6A22034101470D000B0B20060B8C0F03057F047E017F23004180026B220024002000220110000240024002400240024002400240024002400240024002400240024002402001290300200141086A290300844200520D00101241001001220236025441002002101022033602582003410020021002200241034D0D0E4100200328020022043602502002417C6A2102200341046A210302400240024002402004419FBFE9E6054A0D0002402004419CB3A4957D4A0D00200441C99B8FF079460D02200441A89B8AAA7A470D13410F4101410D100F2203280200413F6A41607141C0006A2204101022022004410376100B200141C0003602A001200141A0016A20024104100D2001200328020022003602C801200141C8016A200241C0006A4104100D200241E0006A200341086A2000100A2002413F6A41013A00004120101022034104100B200141F8016A4200370300200142003703F001200142003703E801200142E6003703E001200141E0016A20034120100D200220044102412020034100410010034100450D07410041001004000B2004419BF9C68004460D022004419DB3A4957D470D124100450D0E410041001004000B024002400240200441E382B9CC074A0D00200441A0BFE9E605460D01200441EEE98EBF06460D022004419797CBC406460D050C140B200441E482B9CC07470D13024002400240024020024120490D002003200141106A4118100C200141206A3502002105200141106A41086A290300210620012903102107410810101A410810101A410410102202419797CBC406360200200241046A4100100B200142003703D001200142003703C801200120063703A801200120073703A001200120053E02B001200141A0016A200141E0016A4114100E42FFFFFFFFFFFFFFFFFF00200141E0016A200141C8016A2002410410050D0A1006220241086A101022032002360200200341046A2002360200200341086A220441002002100720033502002205421F580D0120042001419C016A4104100C200135029C01220742207C22062005560D0220042007A76A200141B8016A4104100C0240200620012802B8012202AD7C2005560D0020014100410D2002410120042006A76A100F220241086A2002280200101136022C4100450D170C040B4102450D160C030B20014180026A240041020F0B41020D010C140B4102450D130B410041001004000B41004100100400000B200141C8006A42003703002001420037034020014200370338200142B1A8033703304100450D06410041001004000B20024120490D062003200141D0006A4108100C2002AD2205423F580D0720012903502108200341206A200141D8006A4104100C2001350258220642207C22072005560D0820032006A76A200141DC006A4104100C2007200135025C22067C2005560D092006A7410120032007A76A100F2102410810101A200228020041216A4101417F100F220341086A220441C0004105100A2003410D6A210102402008427F550D002001412D3A0000420020087D2108200141016A21010B200120081013220141C5004106100A200141066A2201200241086A20022802002202100A2003200120026A20046B220236020020042002100841010D0A410041001004000B02400240024020024120490D002003200141E0006A4118100C200141F0006A3502002105200141E0006A41086A29030021062001290360210741041010220241EEE98EBF06360200200241046A4100100B200142003703C001200142003703B801200120063703D001200120073703C801200120053E02D801200141C8016A200141A0016A4114100E42FFFFFFFFFFFFFFFFFF00200141A0016A200141B8016A2002410410050D0D1006220241086A101022032002360200200341046A2002360200200341086A22044100200210072003280200411F4D0D012004200141E0016A4120100C200141F8006A41186A200141E0016A41186A2903003703002001200141F0016A290300370388012001200141E8016A29030037038001200120012903E00137037841000D020C100B20014180026A240041020F0B4102450D0E0B410041001004000B410810101A20014105410141CB00100F360298014100450D0B410041001004000B410041001004000B410041001004000B410041001009000B4120101022024104100B200141306A20024120100D200241201009000B20014180026A240041020F0B20014180026A240041020F0B20014180026A240041020F0B20014180026A240041020F0B410041001009000B410041001004000B410041001009000B200128029801280200413F6A41607141206A2203101022022003410376100B200041706A22042200240020044120360200200420024104100D20012802980122092802002101200041706A22042400200420013602002004200241206A4104100D200241C0006A200941086A2001100A200220031009000B4120101022024104100B200141F8006A20024120100D200241201009000B200128022C280200413F6A41607141206A2203101022022003410376100B200041706A22042200240020044120360200200420024104100D200128022C22092802002101200041706A22042400200420013602002004200241206A4104100D200241C0006A200941086A2001100A200220031009000B410041001004000B0B56010041000B50657761736D2063616C6C65642048656C6C6F2066726F6D207761736D000000007177213B393C76BAF374B5A91F5A8E4A972270CEFDDA6375DF53FB1A3CAC11C9617267313A20617267323A657761736D") +var Abi_ewasm = []byte(`[{"name":"get_vm","type":"function","inputs":[],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"pure"},{"name":"get_number","type":"function","inputs":[],"outputs":[{"name":"","type":"int256","internalType":"int256"}],"stateMutability":"pure"},{"name":"call_get_vm","type":"function","inputs":[{"name":"e","type":"address","internalType":"contract E"}],"outputs":[{"name":"","type":"string","internalType":"string"}],"stateMutability":"nonpayable"},{"name":"call_get_number","type":"function","inputs":[{"name":"e","type":"address","internalType":"contract E"}],"outputs":[{"name":"","type":"int256","internalType":"int256"}],"stateMutability":"nonpayable"},{"name":"try_revert","type":"function","inputs":[],"outputs":[],"stateMutability":"pure"},{"name":"hash_tests","type":"function","inputs":[],"outputs":[],"stateMutability":"pure"},{"name":"test_events","type":"function","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"name":"test_print","type":"function","inputs":[{"name":"arg1","type":"int64","internalType":"int64"},{"name":"arg2","type":"string","internalType":"string"}],"outputs":[],"stateMutability":"nonpayable"},{"name":"L","type":"event","inputs":[{"name":"f1","type":"int256","internalType":"int256","indexed":true},{"name":"f2","type":"string","internalType":"string"},{"name":"f3","type":"bool","internalType":"bool"}],"outputs":[],"stateMutability":""}]`) diff --git a/execution/wasm/contract.go b/execution/wasm/contract.go index 20ad6d7bb..8e99ebbe1 100644 --- a/execution/wasm/contract.go +++ b/execution/wasm/contract.go @@ -5,6 +5,8 @@ import ( "fmt" "math/big" + hex "github.com/tmthrgd/go-hex" + "github.com/hyperledger/burrow/execution/evm" "github.com/hyperledger/burrow/execution/exec" @@ -79,6 +81,140 @@ func (ctx *context) ResolveGlobal(module, field string) int64 { } func (ctx *context) ResolveFunc(module, field string) lifeExec.FunctionImport { + if module == "debug" { + // See https://github.com/ewasm/hera#interfaces + switch field { + case "print32": + return func(vm *lifeExec.VirtualMachine) int64 { + n := int32(vm.GetCurrentFrame().Locals[0]) + + s := fmt.Sprintf("%d", n) + + err := ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: []byte(s), + }) + + if err != nil { + panic(fmt.Sprintf(" => print32 failed: %v", err)) + } + + return Success + } + + case "print64": + return func(vm *lifeExec.VirtualMachine) int64 { + n := int64(vm.GetCurrentFrame().Locals[0]) + + s := fmt.Sprintf("%d", n) + + err := ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: []byte(s), + }) + + if err != nil { + panic(fmt.Sprintf(" => print32 failed: %v", err)) + } + + return Success + } + + case "printMem": + return func(vm *lifeExec.VirtualMachine) int64 { + dataPtr := int(uint32(vm.GetCurrentFrame().Locals[0])) + dataLen := int(uint32(vm.GetCurrentFrame().Locals[1])) + + s := vm.Memory[dataPtr : dataPtr+dataLen] + + err := ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: s, + }) + + if err != nil { + panic(fmt.Sprintf(" => printMem failed: %v", err)) + } + + return Success + } + + case "printMemHex": + return func(vm *lifeExec.VirtualMachine) int64 { + dataPtr := int(uint32(vm.GetCurrentFrame().Locals[0])) + dataLen := int(uint32(vm.GetCurrentFrame().Locals[1])) + + s := hex.EncodeToString(vm.Memory[dataPtr : dataPtr+dataLen]) + + err := ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: []byte(s), + }) + + if err != nil { + panic(fmt.Sprintf(" => printMemHex failed: %v", err)) + } + + return Success + } + + case "printStorage": + return func(vm *lifeExec.VirtualMachine) int64 { + keyPtr := int(uint32(vm.GetCurrentFrame().Locals[0])) + + key := bin.Word256{} + + copy(key[:], vm.Memory[keyPtr:keyPtr+32]) + + val, err := ctx.state.GetStorage(ctx.params.Callee, key) + if err != nil { + panic(err) + } + + err = ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: val, + }) + + if err != nil { + panic(fmt.Sprintf(" => printStorage failed: %v", err)) + } + + return Success + } + + case "printStorageHex": + return func(vm *lifeExec.VirtualMachine) int64 { + keyPtr := int(uint32(vm.GetCurrentFrame().Locals[0])) + + key := bin.Word256{} + + copy(key[:], vm.Memory[keyPtr:keyPtr+32]) + + val, err := ctx.state.GetStorage(ctx.params.Callee, key) + if err != nil { + panic(err) + } + + s := hex.EncodeToString(val) + + err = ctx.state.EventSink.Print(&exec.PrintEvent{ + Address: ctx.params.Callee, + Data: []byte(s), + }) + + if err != nil { + panic(fmt.Sprintf(" => printStorage failed: %v", err)) + } + + return Success + } + + default: + panic(fmt.Sprintf("function %s unknown for debug module", field)) + } + } + if module != "ethereum" { panic(fmt.Sprintf("unknown module %s", module)) } diff --git a/execution/wasm/storage_test.solang.go b/execution/wasm/storage_test.solang.go index 4926872c6..b4548ef47 100644 --- a/execution/wasm/storage_test.solang.go +++ b/execution/wasm/storage_test.solang.go @@ -2,5 +2,5 @@ package wasm import hex "github.com/tmthrgd/go-hex" -var Bytecode_storage_test = hex.MustDecodeString("0061736D01000000011C0660027F7F0060017F006000017F60037F7F7F0060017F017F6000000280010608657468657265756D0C73746F7261676553746F7265000008657468657265756D0C67657443616C6C56616C7565000108657468657265756D0B676574436F646553697A65000208657468657265756D08636F6465436F7079000308657468657265756D0666696E697368000008657468657265756D06726576657274000003060500040502050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E000A0AAB0305240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B4E01017F230041C0006B22002400200041386A4200370300200042003703302000420037032820004200370320200041041006200042E600370300200041206A20001000200041C0006A240041000B5E01027F230041106B220024002000100102402000290300200041086A290300844200520D0010084100100241C0736A22003602B00741002000100722013602B407200141C00C2000100310091A410041AE071004000B410041001005000B0BB507010041000BAE070061736D01000000011C0660017F006000017F60037F7F7F0060027F7F0060017F017F600000029F010708657468657265756D0C67657443616C6C56616C7565000008657468657265756D0F67657443616C6C4461746153697A65000108657468657265756D0C63616C6C44617461436F7079000208657468657265756D0B73746F726167654C6F6164000308657468657265756D0C73746F7261676553746F7265000308657468657265756D06726576657274000308657468657265756D0666696E697368000303060503020405050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E000B0AB20505240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0B2D002001411F6A21010340200120002D00003A00002001417F6A2101200041016A21002002417F6A22020D000B0BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B850302037F017E230041A0016B22002400200041086A100002400240024002402000290308200041106A290300844200520D00100A41001001220136020441002001100922023602082002410020011002200141034D0D014100200228020022013602000240200141A298B6BE01460D00200141DE9AB88F79470D0220004180016A41186A420037030020004200370390012000420037038801200042003703800120004180016A200041E0006A1003200041C0006A41186A420037030020004200370350200042003703482000420037034020002903602103200041206A410410072000200342017C370320200041C0006A200041206A10044100450D03410041001005000B20004198016A420037030020004200370390012000420037038801200042003703800120004180016A200041E0006A10032000200029036042027C3703184100450D03410041001005000B410041001005000B410041001005000B410041001006000B41201009220141041007200041186A200141081008200141201006000B") +var Bytecode_storage_test = hex.MustDecodeString("0061736D01000000011C0660027F7F0060017F006000017F60037F7F7F0060017F017F6000000280010608657468657265756D0C73746F7261676553746F7265000008657468657265756D0C67657443616C6C56616C7565000108657468657265756D0B676574436F646553697A65000208657468657265756D08636F6465436F7079000308657468657265756D0666696E697368000008657468657265756D06726576657274000003060500040502050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E000A0AAB0305240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B4E01017F230041C0006B22002400200041386A4200370300200042003703302000420037032820004200370320200041041006200042E600370300200041206A20001000200041C0006A240041000B5E01027F230041106B220024002000100102402000290300200041086A290300844200520D0010084100100241C0736A22003602B00741002000100722013602B407200141C00C2000100310091A410041AE071004000B410041001005000B0BB507010041000BAE070061736D01000000011C0660017F006000017F60037F7F7F0060027F7F0060017F017F600000029F010708657468657265756D0C67657443616C6C56616C7565000008657468657265756D0F67657443616C6C4461746153697A65000108657468657265756D0C63616C6C44617461436F7079000208657468657265756D0B73746F726167654C6F6164000308657468657265756D06726576657274000308657468657265756D0C73746F7261676553746F7265000308657468657265756D0666696E697368000303060503020405050405017001010105030100020608017F01418080040B071102066D656D6F72790200046D61696E000B0AB20505240002402001450D00034020004200370300200041086A21002001417F6A22010D000B0B0B2D002001411F6A21010340200120002D00003A00002001417F6A2101200041016A21002002417F6A22020D000B0BA60101047F418080042101024003400240200128020C0D002001280208220220004F0D020B200128020022010D000B41002101410028020821020B02402002200041076A41787122036B22024118490D00200120036A41106A22002001280200220436020002402004450D00200420003602040B2000200241706A3602082000410036020C2000200136020420012000360200200120033602080B2001410136020C200141106A0B2E004100410036028080044100410036028480044100410036028C800441003F0041107441F0FF7B6A36028880040B850302037F017E230041A0016B22002400200041086A100002400240024002402000290308200041106A290300844200520D00100A41001001220136020441002001100922023602082002410020011002200141034D0D014100200228020022013602000240200141DE9AB88F79460D00200141A298B6BE01470D0220004198016A420037030020004200370390012000420037038801200042003703800120004180016A200041E0006A10032000200029036042027C3703184100450D03410041001004000B20004180016A41186A420037030020004200370390012000420037038801200042003703800120004180016A200041E0006A1003200041C0006A41186A420037030020004200370350200042003703482000420037034020002903602103200041206A410410072000200342017C370320200041C0006A200041206A10054100450D03410041001004000B410041001004000B410041001004000B41201009220141041007200041186A200141081008200141201006000B410041001006000B") var Abi_storage_test = []byte(`[{"type":"constructor","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"name":"getFooPlus2","type":"function","inputs":[],"outputs":[{"name":"","type":"uint64","internalType":"uint64"}],"stateMutability":"view"},{"name":"incFoo","type":"function","inputs":[],"outputs":[],"stateMutability":"nonpayable"}]`) diff --git a/go.mod b/go.mod index fde9be15e..460e27daf 100644 --- a/go.mod +++ b/go.mod @@ -53,5 +53,6 @@ require ( golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad golang.org/x/net v0.0.0-20210119194325-5f4716e94777 google.golang.org/grpc v1.35.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 03b5108ca..af3ebe66a 100644 --- a/go.sum +++ b/go.sum @@ -834,6 +834,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/integration/rpctransact/call_test.go b/integration/rpctransact/call_test.go index 73a0503db..9323785e7 100644 --- a/integration/rpctransact/call_test.go +++ b/integration/rpctransact/call_test.go @@ -591,6 +591,23 @@ func testCallTx(t *testing.T, kern *core.Kernel, cli rpctransact.TransactClient) assert.Equal(t, true, f3) return }) + + t.Run("WasmPrint", func(t *testing.T) { + t.Parallel() + createTxe, err := rpctest.CreateWASMContract(cli, inputAddress, solidity.Bytecode_ewasm, nil) + require.NoError(t, err) + address := lastCall(createTxe.Events).CallData.Callee + spec, err := abi.ReadSpec(solidity.Abi_ewasm) + require.NoError(t, err) + data, _, err := spec.Pack("test_print", 102, "Fishy") + require.NoError(t, err) + callTxe, err := rpctest.CallContract(cli, inputAddress, address, data) + require.NoError(t, err) + evs := filterPrint(callTxe.Events) + require.Len(t, evs, 1) + assert.Equal(t, string(evs[0].Data), "arg1:102 arg2:Fishy") + return + }) }) } @@ -634,6 +651,16 @@ func filterLogs(evs []*exec.Event) []*exec.LogEvent { return logEvs } +func filterPrint(evs []*exec.Event) []*exec.PrintEvent { + var printEvs []*exec.PrintEvent + for _, ev := range evs { + if ev.Print != nil { + printEvs = append(printEvs, ev.Print) + } + } + return printEvs +} + func lastCall(evs []*exec.Event) *exec.CallEvent { callEvs := filterCalls(evs) return callEvs[len(callEvs)-1] diff --git a/js/proto/exec_pb.d.ts b/js/proto/exec_pb.d.ts index 02ad26ba7..bc1f87597 100644 --- a/js/proto/exec_pb.d.ts +++ b/js/proto/exec_pb.d.ts @@ -511,6 +511,12 @@ export class Event extends jspb.Message { setGovernaccount(value?: GovernAccountEvent): Event; + hasPrint(): boolean; + clearPrint(): void; + getPrint(): PrintEvent | undefined; + setPrint(value?: PrintEvent): Event; + + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Event.AsObject; static toObject(includeInstance: boolean, msg: Event): Event.AsObject; @@ -529,6 +535,7 @@ export namespace Event { call?: CallEvent.AsObject, log?: LogEvent.AsObject, governaccount?: GovernAccountEvent.AsObject, + print?: PrintEvent.AsObject, } } @@ -654,6 +661,35 @@ export namespace CallEvent { } } +export class PrintEvent extends jspb.Message { + getAddress(): Uint8Array | string; + getAddress_asU8(): Uint8Array; + getAddress_asB64(): string; + setAddress(value: Uint8Array | string): PrintEvent; + + getData(): Uint8Array | string; + getData_asU8(): Uint8Array; + getData_asB64(): string; + setData(value: Uint8Array | string): PrintEvent; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PrintEvent.AsObject; + static toObject(includeInstance: boolean, msg: PrintEvent): PrintEvent.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PrintEvent, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PrintEvent; + static deserializeBinaryFromReader(message: PrintEvent, reader: jspb.BinaryReader): PrintEvent; +} + +export namespace PrintEvent { + export type AsObject = { + address: Uint8Array | string, + data: Uint8Array | string, + } +} + export class GovernAccountEvent extends jspb.Message { hasAccountupdate(): boolean; diff --git a/js/proto/exec_pb.js b/js/proto/exec_pb.js index 9056d28f2..cf5598c15 100644 --- a/js/proto/exec_pb.js +++ b/js/proto/exec_pb.js @@ -44,6 +44,7 @@ goog.exportSymbol('proto.exec.InputEvent', null, global); goog.exportSymbol('proto.exec.LogEvent', null, global); goog.exportSymbol('proto.exec.Origin', null, global); goog.exportSymbol('proto.exec.OutputEvent', null, global); +goog.exportSymbol('proto.exec.PrintEvent', null, global); goog.exportSymbol('proto.exec.Result', null, global); goog.exportSymbol('proto.exec.StreamEvent', null, global); goog.exportSymbol('proto.exec.StreamEvents', null, global); @@ -386,6 +387,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.exec.CallEvent.displayName = 'proto.exec.CallEvent'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.exec.PrintEvent = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.exec.PrintEvent, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.exec.PrintEvent.displayName = 'proto.exec.PrintEvent'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -3671,7 +3693,8 @@ proto.exec.Event.toObject = function(includeInstance, msg) { output: (f = msg.getOutput()) && proto.exec.OutputEvent.toObject(includeInstance, f), call: (f = msg.getCall()) && proto.exec.CallEvent.toObject(includeInstance, f), log: (f = msg.getLog()) && proto.exec.LogEvent.toObject(includeInstance, f), - governaccount: (f = msg.getGovernaccount()) && proto.exec.GovernAccountEvent.toObject(includeInstance, f) + governaccount: (f = msg.getGovernaccount()) && proto.exec.GovernAccountEvent.toObject(includeInstance, f), + print: (f = msg.getPrint()) && proto.exec.PrintEvent.toObject(includeInstance, f) }; if (includeInstance) { @@ -3738,6 +3761,11 @@ proto.exec.Event.deserializeBinaryFromReader = function(msg, reader) { reader.readMessage(value,proto.exec.GovernAccountEvent.deserializeBinaryFromReader); msg.setGovernaccount(value); break; + case 7: + var value = new proto.exec.PrintEvent; + reader.readMessage(value,proto.exec.PrintEvent.deserializeBinaryFromReader); + msg.setPrint(value); + break; default: reader.skipField(); break; @@ -3815,6 +3843,14 @@ proto.exec.Event.serializeBinaryToWriter = function(message, writer) { proto.exec.GovernAccountEvent.serializeBinaryToWriter ); } + f = message.getPrint(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.exec.PrintEvent.serializeBinaryToWriter + ); + } }; @@ -4040,6 +4076,43 @@ proto.exec.Event.prototype.hasGovernaccount = function() { }; +/** + * optional PrintEvent Print = 7; + * @return {?proto.exec.PrintEvent} + */ +proto.exec.Event.prototype.getPrint = function() { + return /** @type{?proto.exec.PrintEvent} */ ( + jspb.Message.getWrapperField(this, proto.exec.PrintEvent, 7)); +}; + + +/** + * @param {?proto.exec.PrintEvent|undefined} value + * @return {!proto.exec.Event} returns this +*/ +proto.exec.Event.prototype.setPrint = function(value) { + return jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.exec.Event} returns this + */ +proto.exec.Event.prototype.clearPrint = function() { + return this.setPrint(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.exec.Event.prototype.hasPrint = function() { + return jspb.Message.getField(this, 7) != null; +}; + + @@ -4936,6 +5009,214 @@ proto.exec.CallEvent.prototype.setReturn = function(value) { +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.exec.PrintEvent.prototype.toObject = function(opt_includeInstance) { + return proto.exec.PrintEvent.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.exec.PrintEvent} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.exec.PrintEvent.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.exec.PrintEvent} + */ +proto.exec.PrintEvent.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.exec.PrintEvent; + return proto.exec.PrintEvent.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.exec.PrintEvent} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.exec.PrintEvent} + */ +proto.exec.PrintEvent.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.exec.PrintEvent.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.exec.PrintEvent.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.exec.PrintEvent} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.exec.PrintEvent.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional bytes Address = 1; + * @return {!(string|Uint8Array)} + */ +proto.exec.PrintEvent.prototype.getAddress = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes Address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.exec.PrintEvent.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes Address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.exec.PrintEvent.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.exec.PrintEvent} returns this + */ +proto.exec.PrintEvent.prototype.setAddress = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes Data = 2; + * @return {!(string|Uint8Array)} + */ +proto.exec.PrintEvent.prototype.getData = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes Data = 2; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.exec.PrintEvent.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes Data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.exec.PrintEvent.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.exec.PrintEvent} returns this + */ +proto.exec.PrintEvent.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. diff --git a/keys/keys_grpc.pb.go b/keys/keys_grpc.pb.go index 5b50d28d2..00f2d1450 100644 --- a/keys/keys_grpc.pb.go +++ b/keys/keys_grpc.pb.go @@ -12,6 +12,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // KeysClient is the client API for Keys service. @@ -203,7 +204,7 @@ type UnsafeKeysServer interface { } func RegisterKeysServer(s grpc.ServiceRegistrar, srv KeysServer) { - s.RegisterService(&_Keys_serviceDesc, srv) + s.RegisterService(&Keys_ServiceDesc, srv) } func _Keys_GenerateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -404,7 +405,10 @@ func _Keys_AddName_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -var _Keys_serviceDesc = grpc.ServiceDesc{ +// Keys_ServiceDesc is the grpc.ServiceDesc for Keys service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Keys_ServiceDesc = grpc.ServiceDesc{ ServiceName: "keys.Keys", HandlerType: (*KeysServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/protobuf/exec.proto b/protobuf/exec.proto index fec8be865..7d9106b6b 100644 --- a/protobuf/exec.proto +++ b/protobuf/exec.proto @@ -148,6 +148,7 @@ message Event { CallEvent Call = 4; LogEvent Log = 5; GovernAccountEvent GovernAccount = 6; + PrintEvent Print = 7; } // Could structure this further if needed - sum type of various results relevant to different transaction types @@ -176,6 +177,11 @@ message CallEvent { bytes Return = 4 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false]; } +message PrintEvent { + bytes Address = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/crypto.Address", (gogoproto.nullable) = false]; + bytes Data = 2 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false]; +} + message GovernAccountEvent { spec.TemplateAccount AccountUpdate = 1; } diff --git a/rpc/rpcdump/rpcdump_grpc.pb.go b/rpc/rpcdump/rpcdump_grpc.pb.go index a64c467cd..a764fc6ea 100644 --- a/rpc/rpcdump/rpcdump_grpc.pb.go +++ b/rpc/rpcdump/rpcdump_grpc.pb.go @@ -13,6 +13,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // DumpClient is the client API for Dump service. @@ -31,7 +32,7 @@ func NewDumpClient(cc grpc.ClientConnInterface) DumpClient { } func (c *dumpClient) GetDump(ctx context.Context, in *GetDumpParam, opts ...grpc.CallOption) (Dump_GetDumpClient, error) { - stream, err := c.cc.NewStream(ctx, &_Dump_serviceDesc.Streams[0], "/rpcdump.Dump/GetDump", opts...) + stream, err := c.cc.NewStream(ctx, &Dump_ServiceDesc.Streams[0], "/rpcdump.Dump/GetDump", opts...) if err != nil { return nil, err } @@ -87,7 +88,7 @@ type UnsafeDumpServer interface { } func RegisterDumpServer(s grpc.ServiceRegistrar, srv DumpServer) { - s.RegisterService(&_Dump_serviceDesc, srv) + s.RegisterService(&Dump_ServiceDesc, srv) } func _Dump_GetDump_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -111,7 +112,10 @@ func (x *dumpGetDumpServer) Send(m *dump.Dump) error { return x.ServerStream.SendMsg(m) } -var _Dump_serviceDesc = grpc.ServiceDesc{ +// Dump_ServiceDesc is the grpc.ServiceDesc for Dump service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Dump_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpcdump.Dump", HandlerType: (*DumpServer)(nil), Methods: []grpc.MethodDesc{}, diff --git a/rpc/rpcevents/rpcevents_grpc.pb.go b/rpc/rpcevents/rpcevents_grpc.pb.go index 3d7f33649..2be3c15e7 100644 --- a/rpc/rpcevents/rpcevents_grpc.pb.go +++ b/rpc/rpcevents/rpcevents_grpc.pb.go @@ -13,6 +13,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // ExecutionEventsClient is the client API for ExecutionEvents service. @@ -37,7 +38,7 @@ func NewExecutionEventsClient(cc grpc.ClientConnInterface) ExecutionEventsClient } func (c *executionEventsClient) Stream(ctx context.Context, in *BlocksRequest, opts ...grpc.CallOption) (ExecutionEvents_StreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_ExecutionEvents_serviceDesc.Streams[0], "/rpcevents.ExecutionEvents/Stream", opts...) + stream, err := c.cc.NewStream(ctx, &ExecutionEvents_ServiceDesc.Streams[0], "/rpcevents.ExecutionEvents/Stream", opts...) if err != nil { return nil, err } @@ -78,7 +79,7 @@ func (c *executionEventsClient) Tx(ctx context.Context, in *TxRequest, opts ...g } func (c *executionEventsClient) Events(ctx context.Context, in *BlocksRequest, opts ...grpc.CallOption) (ExecutionEvents_EventsClient, error) { - stream, err := c.cc.NewStream(ctx, &_ExecutionEvents_serviceDesc.Streams[1], "/rpcevents.ExecutionEvents/Events", opts...) + stream, err := c.cc.NewStream(ctx, &ExecutionEvents_ServiceDesc.Streams[1], "/rpcevents.ExecutionEvents/Events", opts...) if err != nil { return nil, err } @@ -146,7 +147,7 @@ type UnsafeExecutionEventsServer interface { } func RegisterExecutionEventsServer(s grpc.ServiceRegistrar, srv ExecutionEventsServer) { - s.RegisterService(&_ExecutionEvents_serviceDesc, srv) + s.RegisterService(&ExecutionEvents_ServiceDesc, srv) } func _ExecutionEvents_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -209,7 +210,10 @@ func (x *executionEventsEventsServer) Send(m *EventsResponse) error { return x.ServerStream.SendMsg(m) } -var _ExecutionEvents_serviceDesc = grpc.ServiceDesc{ +// ExecutionEvents_ServiceDesc is the grpc.ServiceDesc for ExecutionEvents service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExecutionEvents_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpcevents.ExecutionEvents", HandlerType: (*ExecutionEventsServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/rpc/rpcquery/rpcquery_grpc.pb.go b/rpc/rpcquery/rpcquery_grpc.pb.go index 76df0c644..5058f27be 100644 --- a/rpc/rpcquery/rpcquery_grpc.pb.go +++ b/rpc/rpcquery/rpcquery_grpc.pb.go @@ -17,6 +17,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // QueryClient is the client API for Query service. @@ -85,7 +86,7 @@ func (c *queryClient) GetStorage(ctx context.Context, in *GetStorageParam, opts } func (c *queryClient) ListAccounts(ctx context.Context, in *ListAccountsParam, opts ...grpc.CallOption) (Query_ListAccountsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[0], "/rpcquery.Query/ListAccounts", opts...) + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[0], "/rpcquery.Query/ListAccounts", opts...) if err != nil { return nil, err } @@ -126,7 +127,7 @@ func (c *queryClient) GetName(ctx context.Context, in *GetNameParam, opts ...grp } func (c *queryClient) ListNames(ctx context.Context, in *ListNamesParam, opts ...grpc.CallOption) (Query_ListNamesClient, error) { - stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[1], "/rpcquery.Query/ListNames", opts...) + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[1], "/rpcquery.Query/ListNames", opts...) if err != nil { return nil, err } @@ -194,7 +195,7 @@ func (c *queryClient) GetProposal(ctx context.Context, in *GetProposalParam, opt } func (c *queryClient) ListProposals(ctx context.Context, in *ListProposalsParam, opts ...grpc.CallOption) (Query_ListProposalsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[2], "/rpcquery.Query/ListProposals", opts...) + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[2], "/rpcquery.Query/ListProposals", opts...) if err != nil { return nil, err } @@ -321,7 +322,7 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) + s.RegisterService(&Query_ServiceDesc, srv) } func _Query_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -585,7 +586,10 @@ func _Query_GetBlockHeader_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpcquery.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ diff --git a/rpc/rpctransact/rpctransact_grpc.pb.go b/rpc/rpctransact/rpctransact_grpc.pb.go index 9a70d6fb1..124ee37c0 100644 --- a/rpc/rpctransact/rpctransact_grpc.pb.go +++ b/rpc/rpctransact/rpctransact_grpc.pb.go @@ -15,6 +15,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // TransactClient is the client API for Transact service. @@ -248,7 +249,7 @@ type UnsafeTransactServer interface { } func RegisterTransactServer(s grpc.ServiceRegistrar, srv TransactServer) { - s.RegisterService(&_Transact_serviceDesc, srv) + s.RegisterService(&Transact_ServiceDesc, srv) } func _Transact_BroadcastTxSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -467,7 +468,10 @@ func _Transact_NameTxAsync_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -var _Transact_serviceDesc = grpc.ServiceDesc{ +// Transact_ServiceDesc is the grpc.ServiceDesc for Transact service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Transact_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpctransact.Transact", HandlerType: (*TransactServer)(nil), Methods: []grpc.MethodDesc{