New RPC call

This commit is contained in:
Aditya Kulkarni
2019-09-10 16:34:01 -07:00
parent 595de96e2b
commit b4796bc67e
5 changed files with 333 additions and 42 deletions

View File

@@ -3,7 +3,7 @@ package frontend
import (
"net"
"github.com/btcsuite/btcd/rpcclient"
"github.com/adityapk00/btcd/rpcclient"
"github.com/pkg/errors"
ini "gopkg.in/ini.v1"
)

View File

@@ -11,7 +11,7 @@ import (
"strings"
"time"
"github.com/btcsuite/btcd/rpcclient"
"github.com/adityapk00/btcd/rpcclient"
"github.com/golang/protobuf/proto"
// blank import for sqlite driver support
@@ -86,6 +86,12 @@ func (s *SqlStreamer) GetBlock(ctx context.Context, id *walletrpc.BlockID) (*wal
return cBlock, err
}
func (s *SqlStreamer) GetUtxos(address *walletrpc.TransparentAddress, resp walletrpc.CompactTxStreamer_GetUtxosServer) error {
s.client.GetAddressUtxos("someaddress")
return nil
}
func (s *SqlStreamer) GetBlockRange(span *walletrpc.BlockRange, resp walletrpc.CompactTxStreamer_GetBlockRangeServer) error {
blockChan := make(chan []byte)
errChan := make(chan error)
@@ -154,12 +160,13 @@ func (s *SqlStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilte
}
// GetLightdInfo gets the LightWalletD (this server) info
func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*walletrpc.SendResponse, error) {
func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*walletrpc.LightdInfo, error) {
// TODO these are called Error but they aren't at the moment.
// A success will return code 0 and message txhash.
return &walletrpc.SendResponse{
ErrorCode: int32(0),
ErrorMessage: "Go Light Server",
return &walletrpc.LightdInfo{
Version: "0.1-zeclightd",
Vendor: "ZecWallet LightWalletD",
TaddrSupport: true,
}, nil
}