add darksidewallet support for GetAddressUtxos
Add a new darksidewallet gRPC to add a utxo that can be returned by the production GetAddressUtxos, for example: grpcurl -plaintext -d '{"address":"t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV","txid":"1zjB42Z7FtwRZOBNMlTubCgx9l3dsZSqXxmWpuZXJto=","script": "dqkU8saQsCVS4mNwcByoGCtfOaHFaCiIrA==","valueZat": "3010000","height": "686773"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo Then the following returns this entry: grpcurl -plaintext -d '{"startHeight":0,"maxEntries":2,"addresses":["t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV"]}' localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos You can also clear the list of entries: grpcurl -plaintext localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo
This commit is contained in:
parent
dcad72ed25
commit
4e561f2cfd
|
@ -125,7 +125,7 @@ type (
|
||||||
ZcashdRpcRequestGetaddressutxos struct {
|
ZcashdRpcRequestGetaddressutxos struct {
|
||||||
Addresses []string `json:"addresses"`
|
Addresses []string `json:"addresses"`
|
||||||
}
|
}
|
||||||
ZcashdRpcReplyGetaddressutxos []struct {
|
ZcashdRpcReplyGetaddressutxos struct {
|
||||||
Address string
|
Address string
|
||||||
Txid string
|
Txid string
|
||||||
OutputIndex int64
|
OutputIndex int64
|
||||||
|
|
|
@ -46,6 +46,9 @@ type darksideState struct {
|
||||||
// These transactions come from StageTransactions(); they will be merged into
|
// These transactions come from StageTransactions(); they will be merged into
|
||||||
// activeBlocks by ApplyStaged() (and this list then cleared).
|
// activeBlocks by ApplyStaged() (and this list then cleared).
|
||||||
stagedTransactions []stagedTx
|
stagedTransactions []stagedTx
|
||||||
|
|
||||||
|
// Unordered list of replies
|
||||||
|
getAddressUtxos []ZcashdRpcReplyGetaddressutxos
|
||||||
}
|
}
|
||||||
|
|
||||||
var state darksideState
|
var state darksideState
|
||||||
|
@ -459,6 +462,23 @@ func darksideRawRequest(method string, params []json.RawMessage) (json.RawMessag
|
||||||
}
|
}
|
||||||
return json.Marshal(reply)
|
return json.Marshal(reply)
|
||||||
|
|
||||||
|
case "getaddressutxos":
|
||||||
|
var req ZcashdRpcRequestGetaddressutxos
|
||||||
|
err := json.Unmarshal(params[0], &req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("failed to parse getaddressutxos JSON")
|
||||||
|
}
|
||||||
|
utxosReply := make([]ZcashdRpcReplyGetaddressutxos, 0)
|
||||||
|
for _, utxo := range state.getAddressUtxos {
|
||||||
|
for _, a := range req.Addresses {
|
||||||
|
if a == utxo.Address {
|
||||||
|
utxosReply = append(utxosReply, utxo)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json.Marshal(utxosReply)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("there was an attempt to call an unsupported RPC")
|
return nil, errors.New("there was an attempt to call an unsupported RPC")
|
||||||
}
|
}
|
||||||
|
@ -585,3 +605,13 @@ func DarksideStageTransactionsURL(height int, url string) error {
|
||||||
return scan.Err()
|
return scan.Err()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DarksideAddAddressUtxo(arg ZcashdRpcReplyGetaddressutxos) error {
|
||||||
|
state.getAddressUtxos = append(state.getAddressUtxos, arg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func DarksideClearAddressUtxos() error {
|
||||||
|
state.getAddressUtxos = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -527,7 +527,7 @@ func getAddressUtxos(arg *walletrpc.GetAddressUtxosArg, f func(*walletrpc.GetAdd
|
||||||
if rpcErr != nil {
|
if rpcErr != nil {
|
||||||
return rpcErr
|
return rpcErr
|
||||||
}
|
}
|
||||||
var utxosReply common.ZcashdRpcReplyGetaddressutxos
|
var utxosReply []common.ZcashdRpcReplyGetaddressutxos
|
||||||
err = json.Unmarshal(result, &utxosReply)
|
err = json.Unmarshal(result, &utxosReply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -706,3 +706,23 @@ func (s *DarksideStreamer) ClearIncomingTransactions(ctx context.Context, e *wal
|
||||||
common.DarksideClearIncomingTransactions()
|
common.DarksideClearIncomingTransactions()
|
||||||
return &walletrpc.Empty{}, nil
|
return &walletrpc.Empty{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddAddressUtxo adds a UTXO which will be returned by GetAddressUtxos() (above)
|
||||||
|
func (s *DarksideStreamer) AddAddressUtxo(ctx context.Context, arg *walletrpc.GetAddressUtxosReply) (*walletrpc.Empty, error) {
|
||||||
|
utxosReply := common.ZcashdRpcReplyGetaddressutxos{
|
||||||
|
Address: arg.Address,
|
||||||
|
Txid: hex.EncodeToString(parser.Reverse(arg.Txid)),
|
||||||
|
OutputIndex: int64(arg.Index),
|
||||||
|
Script: hex.EncodeToString(arg.Script),
|
||||||
|
Satoshis: uint64(arg.ValueZat),
|
||||||
|
Height: int(arg.Height),
|
||||||
|
}
|
||||||
|
err := common.DarksideAddAddressUtxo(utxosReply)
|
||||||
|
return &walletrpc.Empty{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClearAddressUtxo removes the list of cached utxo entries
|
||||||
|
func (s *DarksideStreamer) ClearAddressUtxo(ctx context.Context, arg *walletrpc.Empty) (*walletrpc.Empty, error) {
|
||||||
|
err := common.DarksideClearAddressUtxos()
|
||||||
|
return &walletrpc.Empty{}, err
|
||||||
|
}
|
||||||
|
|
|
@ -383,7 +383,7 @@ var file_darkside_proto_rawDesc = []byte{
|
||||||
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12,
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12,
|
||||||
0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||||
0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03,
|
0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xda, 0x06, 0x0a, 0x10,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x8b, 0x08, 0x0a, 0x10,
|
||||||
0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x72,
|
0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x72,
|
||||||
0x12, 0x51, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x68,
|
0x12, 0x51, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x68,
|
||||||
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
|
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
|
||||||
|
@ -437,9 +437,20 @@ var file_darkside_proto_rawDesc = []byte{
|
||||||
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
|
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
|
||||||
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e,
|
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e,
|
||||||
0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63,
|
0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63,
|
||||||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x1b, 0x5a, 0x16, 0x6c, 0x69, 0x67, 0x68,
|
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x41,
|
||||||
0x74, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x64, 0x2f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x72,
|
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x2b, 0x2e, 0x63, 0x61, 0x73,
|
||||||
0x70, 0x63, 0xba, 0x02, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
|
||||||
|
0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78,
|
||||||
|
0x6f, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a,
|
||||||
|
0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e,
|
||||||
|
0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61, 0x72,
|
||||||
|
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x1c, 0x2e, 0x63, 0x61,
|
||||||
|
0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e,
|
||||||
|
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68,
|
||||||
|
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
|
||||||
|
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x1b, 0x5a, 0x16, 0x6c, 0x69, 0x67,
|
||||||
|
0x68, 0x74, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x64, 0x2f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
|
||||||
|
0x72, 0x70, 0x63, 0xba, 0x02, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -464,31 +475,36 @@ var file_darkside_proto_goTypes = []interface{}{
|
||||||
(*DarksideEmptyBlocks)(nil), // 5: cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
|
(*DarksideEmptyBlocks)(nil), // 5: cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
|
||||||
(*RawTransaction)(nil), // 6: cash.z.wallet.sdk.rpc.RawTransaction
|
(*RawTransaction)(nil), // 6: cash.z.wallet.sdk.rpc.RawTransaction
|
||||||
(*Empty)(nil), // 7: cash.z.wallet.sdk.rpc.Empty
|
(*Empty)(nil), // 7: cash.z.wallet.sdk.rpc.Empty
|
||||||
|
(*GetAddressUtxosReply)(nil), // 8: cash.z.wallet.sdk.rpc.GetAddressUtxosReply
|
||||||
}
|
}
|
||||||
var file_darkside_proto_depIdxs = []int32{
|
var file_darkside_proto_depIdxs = []int32{
|
||||||
0, // 0: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:input_type -> cash.z.wallet.sdk.rpc.DarksideMetaState
|
0, // 0: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:input_type -> cash.z.wallet.sdk.rpc.DarksideMetaState
|
||||||
1, // 1: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:input_type -> cash.z.wallet.sdk.rpc.DarksideBlock
|
1, // 1: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:input_type -> cash.z.wallet.sdk.rpc.DarksideBlock
|
||||||
2, // 2: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:input_type -> cash.z.wallet.sdk.rpc.DarksideBlocksURL
|
2, // 2: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:input_type -> cash.z.wallet.sdk.rpc.DarksideBlocksURL
|
||||||
5, // 3: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:input_type -> cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
|
5, // 3: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:input_type -> cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
|
||||||
6, // 4: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:input_type -> cash.z.wallet.sdk.rpc.RawTransaction
|
6, // 4: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:input_type -> cash.z.wallet.sdk.rpc.RawTransaction
|
||||||
3, // 5: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:input_type -> cash.z.wallet.sdk.rpc.DarksideTransactionsURL
|
3, // 5: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:input_type -> cash.z.wallet.sdk.rpc.DarksideTransactionsURL
|
||||||
4, // 6: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:input_type -> cash.z.wallet.sdk.rpc.DarksideHeight
|
4, // 6: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:input_type -> cash.z.wallet.sdk.rpc.DarksideHeight
|
||||||
7, // 7: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 7: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 8: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 8: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 9: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:output_type -> cash.z.wallet.sdk.rpc.Empty
|
8, // 9: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.GetAddressUtxosReply
|
||||||
7, // 10: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 10: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 11: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 11: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 12: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 12: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 13: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 13: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 14: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 14: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 15: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 15: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
6, // 16: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.RawTransaction
|
7, // 16: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
7, // 17: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
|
7, // 17: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
9, // [9:18] is the sub-list for method output_type
|
6, // 18: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.RawTransaction
|
||||||
0, // [0:9] is the sub-list for method input_type
|
7, // 19: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
0, // [0:0] is the sub-list for extension type_name
|
7, // 20: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
0, // [0:0] is the sub-list for extension extendee
|
7, // 21: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
|
||||||
0, // [0:0] is the sub-list for field type_name
|
11, // [11:22] is the sub-list for method output_type
|
||||||
|
0, // [0:11] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_darkside_proto_init() }
|
func init() { file_darkside_proto_init() }
|
||||||
|
|
|
@ -114,4 +114,11 @@ service DarksideStreamer {
|
||||||
|
|
||||||
// Clear the incoming transaction pool.
|
// Clear the incoming transaction pool.
|
||||||
rpc ClearIncomingTransactions(Empty) returns (Empty) {}
|
rpc ClearIncomingTransactions(Empty) returns (Empty) {}
|
||||||
|
|
||||||
|
// Add a GetAddressUtxosReply entry to be returned by GetAddressUtxos().
|
||||||
|
// There is no staging or applying for these, very simple.
|
||||||
|
rpc AddAddressUtxo(GetAddressUtxosReply) returns (Empty) {}
|
||||||
|
|
||||||
|
// Clear the list of GetAddressUtxos entries (can't fail)
|
||||||
|
rpc ClearAddressUtxo(Empty) returns (Empty) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,11 @@ type DarksideStreamerClient interface {
|
||||||
GetIncomingTransactions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DarksideStreamer_GetIncomingTransactionsClient, error)
|
GetIncomingTransactions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DarksideStreamer_GetIncomingTransactionsClient, error)
|
||||||
// Clear the incoming transaction pool.
|
// Clear the incoming transaction pool.
|
||||||
ClearIncomingTransactions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
ClearIncomingTransactions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||||
|
// Add a GetAddressUtxosReply entry to be returned by GetAddressUtxos().
|
||||||
|
// There is no staging or applying for these, very simple.
|
||||||
|
AddAddressUtxo(ctx context.Context, in *GetAddressUtxosReply, opts ...grpc.CallOption) (*Empty, error)
|
||||||
|
// Clear the list of GetAddressUtxos entries (can't fail)
|
||||||
|
ClearAddressUtxo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type darksideStreamerClient struct {
|
type darksideStreamerClient struct {
|
||||||
|
@ -240,6 +245,24 @@ func (c *darksideStreamerClient) ClearIncomingTransactions(ctx context.Context,
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *darksideStreamerClient) AddAddressUtxo(ctx context.Context, in *GetAddressUtxosReply, opts ...grpc.CallOption) (*Empty, error) {
|
||||||
|
out := new(Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *darksideStreamerClient) ClearAddressUtxo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
|
||||||
|
out := new(Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// DarksideStreamerServer is the server API for DarksideStreamer service.
|
// DarksideStreamerServer is the server API for DarksideStreamer service.
|
||||||
// All implementations must embed UnimplementedDarksideStreamerServer
|
// All implementations must embed UnimplementedDarksideStreamerServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
|
@ -302,6 +325,11 @@ type DarksideStreamerServer interface {
|
||||||
GetIncomingTransactions(*Empty, DarksideStreamer_GetIncomingTransactionsServer) error
|
GetIncomingTransactions(*Empty, DarksideStreamer_GetIncomingTransactionsServer) error
|
||||||
// Clear the incoming transaction pool.
|
// Clear the incoming transaction pool.
|
||||||
ClearIncomingTransactions(context.Context, *Empty) (*Empty, error)
|
ClearIncomingTransactions(context.Context, *Empty) (*Empty, error)
|
||||||
|
// Add a GetAddressUtxosReply entry to be returned by GetAddressUtxos().
|
||||||
|
// There is no staging or applying for these, very simple.
|
||||||
|
AddAddressUtxo(context.Context, *GetAddressUtxosReply) (*Empty, error)
|
||||||
|
// Clear the list of GetAddressUtxos entries (can't fail)
|
||||||
|
ClearAddressUtxo(context.Context, *Empty) (*Empty, error)
|
||||||
mustEmbedUnimplementedDarksideStreamerServer()
|
mustEmbedUnimplementedDarksideStreamerServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,6 +364,12 @@ func (UnimplementedDarksideStreamerServer) GetIncomingTransactions(*Empty, Darks
|
||||||
func (UnimplementedDarksideStreamerServer) ClearIncomingTransactions(context.Context, *Empty) (*Empty, error) {
|
func (UnimplementedDarksideStreamerServer) ClearIncomingTransactions(context.Context, *Empty) (*Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ClearIncomingTransactions not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ClearIncomingTransactions not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedDarksideStreamerServer) AddAddressUtxo(context.Context, *GetAddressUtxosReply) (*Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method AddAddressUtxo not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDarksideStreamerServer) ClearAddressUtxo(context.Context, *Empty) (*Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ClearAddressUtxo not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedDarksideStreamerServer) mustEmbedUnimplementedDarksideStreamerServer() {}
|
func (UnimplementedDarksideStreamerServer) mustEmbedUnimplementedDarksideStreamerServer() {}
|
||||||
|
|
||||||
// UnsafeDarksideStreamerServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeDarksideStreamerServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
@ -530,6 +564,42 @@ func _DarksideStreamer_ClearIncomingTransactions_Handler(srv interface{}, ctx co
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _DarksideStreamer_AddAddressUtxo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetAddressUtxosReply)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DarksideStreamerServer).AddAddressUtxo(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DarksideStreamerServer).AddAddressUtxo(ctx, req.(*GetAddressUtxosReply))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _DarksideStreamer_ClearAddressUtxo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(Empty)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DarksideStreamerServer).ClearAddressUtxo(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DarksideStreamerServer).ClearAddressUtxo(ctx, req.(*Empty))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// DarksideStreamer_ServiceDesc is the grpc.ServiceDesc for DarksideStreamer service.
|
// DarksideStreamer_ServiceDesc is the grpc.ServiceDesc for DarksideStreamer service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
@ -561,6 +631,14 @@ var DarksideStreamer_ServiceDesc = grpc.ServiceDesc{
|
||||||
MethodName: "ClearIncomingTransactions",
|
MethodName: "ClearIncomingTransactions",
|
||||||
Handler: _DarksideStreamer_ClearIncomingTransactions_Handler,
|
Handler: _DarksideStreamer_ClearIncomingTransactions_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "AddAddressUtxo",
|
||||||
|
Handler: _DarksideStreamer_AddAddressUtxo_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ClearAddressUtxo",
|
||||||
|
Handler: _DarksideStreamer_ClearAddressUtxo_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{
|
Streams: []grpc.StreamDesc{
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue