Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tests for receiving funds #85

Merged
merged 1 commit into from
Nov 29, 2024
Merged

feat: add tests for receiving funds #85

merged 1 commit into from
Nov 29, 2024

Conversation

limpbrains
Copy link
Collaborator

@limpbrains limpbrains commented Nov 25, 2024

Depends on #84

  • tests for receiving funds
  • emit "transactionReceived" event later, when the wallet state might be more accurate
  • new MessageListener class to test wallet onMessage

I also moved before / beforeEach methonds inside describe to avoid executing them before all tests. They were interfearing and breaking electrum connection.

Before


Storage before
Transaction before
Wallet before
  Boost
Boost beforeEach
    ✔ Should fail in some cases. (2664ms)
Boost beforeEach
    ✔ Should generate CPFP for send transaction (2128ms)
Boost beforeEach
    ✔ Should generate RBF for send transaction (1967ms)

  Electrum Methods
Boost beforeEach
    ✔ connectToElectrum: Should connect to a random Electrum server (291ms)
Boost beforeEach
    ✔ isConnected: Should return true if connected to an Electrum server (47ms)
Boost beforeEach
    ✔ getAddressBalance: Should return the balance (in sats) of the provided address (314ms)
Boost beforeEach
    ✔ getNextAvailableAddress: Should return the next available address/change index and the last used address/change index (576ms)
Boost beforeEach
    ✔ Should return available UTXO's (3340ms)
 ...

After:


 Boost
Boost beforeEach
   ✔ Should fail in some cases. (2698ms)
Boost beforeEach
   ✔ Should generate CPFP for send transaction (2124ms)
Boost beforeEach
   ✔ Should generate RBF for send transaction (2105ms)

 Electrum Methods
Electrum before
   ✔ connectToElectrum: Should connect to a random Electrum server (299ms)
   ✔ isConnected: Should return true if connected to an Electrum server (295ms)
   ✔ getAddressBalance: Should return the balance (in sats) of the provided address (307ms)
   ✔ getNextAvailableAddress: Should return the next available address/change index and the last used address/change index (748ms)
   ✔ Should return available UTXO's (3794ms)

@limpbrains limpbrains force-pushed the receive branch 2 times, most recently from 2ae086b to c56ea7a Compare November 27, 2024 16:49
@limpbrains limpbrains marked this pull request as ready for review November 27, 2024 17:23
@limpbrains limpbrains merged commit fefb904 into master Nov 29, 2024
3 checks passed
@limpbrains limpbrains deleted the receive branch November 29, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants