Drop unconditional forfeits txs in offline payment (#344)

* remove unconditionnal forfeit tx

* fix sqlite vtxo repo

* remove pendingData struct

* delete uncond_forfeits_tx table
This commit is contained in:
Louis Singer
2024-10-04 18:06:00 +02:00
committed by GitHub
parent 1d40892196
commit 7606b4cd00
33 changed files with 1654 additions and 1041 deletions

View File

@@ -238,24 +238,23 @@ func (a *grpcClient) Ping(
func (a *grpcClient) CreatePayment(
ctx context.Context, inputs []client.Input, outputs []client.Output,
) (string, []string, error) {
) (string, error) {
req := &arkv1.CreatePaymentRequest{
Inputs: ins(inputs).toProto(),
Outputs: outs(outputs).toProto(),
}
resp, err := a.svc.CreatePayment(ctx, req)
if err != nil {
return "", nil, err
return "", err
}
return resp.SignedRedeemTx, resp.UsignedUnconditionalForfeitTxs, nil
return resp.SignedRedeemTx, nil
}
func (a *grpcClient) CompletePayment(
ctx context.Context, redeemTx string, signedForfeitTxs []string,
ctx context.Context, redeemTx string,
) error {
req := &arkv1.CompletePaymentRequest{
SignedRedeemTx: redeemTx,
SignedUnconditionalForfeitTxs: signedForfeitTxs,
SignedRedeemTx: redeemTx,
}
_, err := a.svc.CompletePayment(ctx, req)
return err