rpcprotos: switch amount in sendmany from uint64 to int64

* In order to be compatible with btcutil.Amount
This commit is contained in:
Olaoluwa Osuntokun 2015-12-29 17:08:04 -06:00
parent dcd9e69d90
commit 1acc528bda
2 changed files with 55 additions and 23 deletions

@ -17,28 +17,29 @@ It has these top-level messages:
package lnrpc package lnrpc
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import ( import (
context "golang.org/x/net/context" context "golang.org/x/net/context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type SendManyRequest struct { type SendManyRequest struct {
AddrToAmount map[string]uint64 `protobuf:"bytes,1,rep" json:"AddrToAmount,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` AddrToAmount map[string]int64 `protobuf:"bytes,1,rep,name=AddrToAmount" json:"AddrToAmount,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
} }
func (m *SendManyRequest) Reset() { *m = SendManyRequest{} } func (m *SendManyRequest) Reset() { *m = SendManyRequest{} }
func (m *SendManyRequest) String() string { return proto.CompactTextString(m) } func (m *SendManyRequest) String() string { return proto.CompactTextString(m) }
func (*SendManyRequest) ProtoMessage() {} func (*SendManyRequest) ProtoMessage() {}
func (*SendManyRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *SendManyRequest) GetAddrToAmount() map[string]uint64 { func (m *SendManyRequest) GetAddrToAmount() map[string]int64 {
if m != nil { if m != nil {
return m.AddrToAmount return m.AddrToAmount
} }
@ -49,28 +50,39 @@ type SendManyResponse struct {
Txid string `protobuf:"bytes,1,opt,name=txid" json:"txid,omitempty"` Txid string `protobuf:"bytes,1,opt,name=txid" json:"txid,omitempty"`
} }
func (m *SendManyResponse) Reset() { *m = SendManyResponse{} } func (m *SendManyResponse) Reset() { *m = SendManyResponse{} }
func (m *SendManyResponse) String() string { return proto.CompactTextString(m) } func (m *SendManyResponse) String() string { return proto.CompactTextString(m) }
func (*SendManyResponse) ProtoMessage() {} func (*SendManyResponse) ProtoMessage() {}
func (*SendManyResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type NewAddressRequest struct { type NewAddressRequest struct {
} }
func (m *NewAddressRequest) Reset() { *m = NewAddressRequest{} } func (m *NewAddressRequest) Reset() { *m = NewAddressRequest{} }
func (m *NewAddressRequest) String() string { return proto.CompactTextString(m) } func (m *NewAddressRequest) String() string { return proto.CompactTextString(m) }
func (*NewAddressRequest) ProtoMessage() {} func (*NewAddressRequest) ProtoMessage() {}
func (*NewAddressRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
type NewAddressResponse struct { type NewAddressResponse struct {
Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
} }
func (m *NewAddressResponse) Reset() { *m = NewAddressResponse{} } func (m *NewAddressResponse) Reset() { *m = NewAddressResponse{} }
func (m *NewAddressResponse) String() string { return proto.CompactTextString(m) } func (m *NewAddressResponse) String() string { return proto.CompactTextString(m) }
func (*NewAddressResponse) ProtoMessage() {} func (*NewAddressResponse) ProtoMessage() {}
func (*NewAddressResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func init() { func init() {
proto.RegisterType((*SendManyRequest)(nil), "lnrpc.SendManyRequest")
proto.RegisterType((*SendManyResponse)(nil), "lnrpc.SendManyResponse")
proto.RegisterType((*NewAddressRequest)(nil), "lnrpc.NewAddressRequest")
proto.RegisterType((*NewAddressResponse)(nil), "lnrpc.NewAddressResponse")
} }
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for LightningServer service // Client API for LightningServer service
type LightningServerClient interface { type LightningServerClient interface {
@ -115,9 +127,9 @@ func RegisterLightningServerServer(s *grpc.Server, srv LightningServerServer) {
s.RegisterService(&_LightningServer_serviceDesc, srv) s.RegisterService(&_LightningServer_serviceDesc, srv)
} }
func _LightningServer_SendMany_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { func _LightningServer_SendMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(SendManyRequest) in := new(SendManyRequest)
if err := codec.Unmarshal(buf, in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
out, err := srv.(LightningServerServer).SendMany(ctx, in) out, err := srv.(LightningServerServer).SendMany(ctx, in)
@ -127,9 +139,9 @@ func _LightningServer_SendMany_Handler(srv interface{}, ctx context.Context, cod
return out, nil return out, nil
} }
func _LightningServer_NewAddress_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) { func _LightningServer_NewAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(NewAddressRequest) in := new(NewAddressRequest)
if err := codec.Unmarshal(buf, in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
out, err := srv.(LightningServerServer).NewAddress(ctx, in) out, err := srv.(LightningServerServer).NewAddress(ctx, in)
@ -154,3 +166,23 @@ var _LightningServer_serviceDesc = grpc.ServiceDesc{
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
} }
var fileDescriptor0 = []byte{
// 246 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2c, 0x2a, 0x48, 0xd6,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcd, 0xc9, 0x03, 0x72, 0x94, 0xda, 0x18, 0xb9, 0xf8,
0x83, 0x53, 0xf3, 0x52, 0x7c, 0x13, 0xf3, 0x2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1,
0xc8, 0x40, 0x8c, 0x48, 0x62, 0x03, 0x47, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x21, 0x47,
0x49, 0x2f, 0x95, 0x01, 0x00, 0x00,
}

@ -8,7 +8,7 @@ service LightningServer {
} }
message SendManyRequest { message SendManyRequest {
map<string, uint64> AddrToAmount = 1; map<string, int64> AddrToAmount = 1;
} }
message SendManyResponse { message SendManyResponse {
string txid = 1; string txid = 1;