mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 20:24:21 +01:00
Move redeem transactions creation client-side (#388)
* move OOR transaction creation client-side * robust redeem tx checks * optimize GetVtxos db call * rename CompleteAsyncPayment --> SubmitRedeemTx * fix permissions.go
This commit is contained in:
@@ -245,28 +245,19 @@ func (a *grpcClient) Ping(
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *grpcClient) CreatePayment(
|
||||
ctx context.Context, inputs []client.AsyncPaymentInput, outputs []client.Output,
|
||||
func (a *grpcClient) SubmitRedeemTx(
|
||||
ctx context.Context, redeemTx string,
|
||||
) (string, error) {
|
||||
req := &arkv1.CreatePaymentRequest{
|
||||
Inputs: asyncIns(inputs).toProto(),
|
||||
Outputs: outs(outputs).toProto(),
|
||||
req := &arkv1.SubmitRedeemTxRequest{
|
||||
RedeemTx: redeemTx,
|
||||
}
|
||||
resp, err := a.svc.CreatePayment(ctx, req)
|
||||
|
||||
resp, err := a.svc.SubmitRedeemTx(ctx, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return resp.SignedRedeemTx, nil
|
||||
}
|
||||
|
||||
func (a *grpcClient) CompletePayment(
|
||||
ctx context.Context, redeemTx string,
|
||||
) error {
|
||||
req := &arkv1.CompletePaymentRequest{
|
||||
SignedRedeemTx: redeemTx,
|
||||
}
|
||||
_, err := a.svc.CompletePayment(ctx, req)
|
||||
return err
|
||||
return resp.GetSignedRedeemTx(), nil
|
||||
}
|
||||
|
||||
func (a *grpcClient) GetRound(
|
||||
|
||||
Reference in New Issue
Block a user