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:
Louis Singer
2024-11-25 13:38:04 +01:00
committed by GitHub
parent d184fc0f41
commit 12d666bfdf
67 changed files with 1772 additions and 5548 deletions

View File

@@ -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(