From 7ca3886f775dc0cea14871dd1d23f4959646dd83 Mon Sep 17 00:00:00 2001 From: Nazarii-4chain Date: Fri, 26 Jan 2024 09:43:13 +0200 Subject: [PATCH] Improved tests --- action_transaction_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/action_transaction_test.go b/action_transaction_test.go index e4b05114..301b126e 100644 --- a/action_transaction_test.go +++ b/action_transaction_test.go @@ -187,6 +187,30 @@ func Test_RevertTransaction(t *testing.T) { }) } +func Test_RecordTransaction(t *testing.T) { + //var secondTransaction *Transaction + ctx, client, _ := initSimpleTestCase(t) + draftTransaction := newDraftTransaction( + testXPub, &TransactionConfig{ + Outputs: []*TransactionOutput{{ + To: "1A1PjKqjWMNBzTVdcBru27EV1PHcXWc63W", + Satoshis: 1000, + }}, + ChangeNumberOfDestinations: 1, + Sync: &SyncConfig{ + Broadcast: true, + BroadcastInstant: false, + PaymailP2P: false, + SyncOnChain: false, + }, + }, + append(client.DefaultModelOptions(), New())..., + ) + + _, err := client.RecordTransaction(ctx, testXPub, "test", draftTransaction.ID, client.DefaultModelOptions()...) + require.Error(t, err) +} + func initRevertTransactionData(t *testing.T) (context.Context, ClientInterface, *Transaction, *bip32.ExtendedKey, func()) { // this creates an xpub, destination and utxo ctx, client, deferMe := initSimpleTestCase(t)