rpcserver: add compile time interface assertion

This commit is contained in:
Olaoluwa Osuntokun 2015-12-29 17:21:42 -06:00
parent 02aa54f127
commit 0620580937

View File

@ -6,7 +6,6 @@ import (
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcwallet/waddrmgr"
"golang.org/x/net/context"
"google.golang.org/grpc"
"li.lan/labs/plasma/lnwallet"
"li.lan/labs/plasma/rpcprotos"
)
@ -20,14 +19,15 @@ type rpcServer struct {
lnwallet *lnwallet.LightningWallet
}
var _ lnrpc.LightningServer = (*rpcServer)(nil)
// newRpcServer...
func newRpcServer(wallet *lnwallet.LightningWallet) *rpcServer {
return &rpcServer{wallet}
}
// SendMany...
func (r *rpcServer) SendMany(ctx context.Context, in *lnrpc.SendManyRequest,
opts ...grpc.CallOption) (*lnrpc.SendManyResponse, error) {
func (r *rpcServer) SendMany(ctx context.Context, in *lnrpc.SendManyRequest) (*lnrpc.SendManyResponse, error) {
sendMap := make(map[string]btcutil.Amount)
for addr, amt := range in.AddrToAmount {
@ -43,8 +43,7 @@ func (r *rpcServer) SendMany(ctx context.Context, in *lnrpc.SendManyRequest,
}
// NewAddress...
func (r *rpcServer) NewAddress(ctx context.Context, in *lnrpc.NewAddressRequest,
opts ...grpc.CallOption) (*lnrpc.NewAddressResponse, error) {
func (r *rpcServer) NewAddress(ctx context.Context, in *lnrpc.NewAddressRequest) (*lnrpc.NewAddressResponse, error) {
r.lnwallet.KeyGenMtx.Lock()
defer r.lnwallet.KeyGenMtx.Unlock()