synonymdev / beignet

An instant, self-custodial Bitcoin wallet for JS devs.
MIT License
22 stars 6 forks source link

feat: add tests for receiving funds #85

Closed limpbrains closed 19 hours ago

limpbrains commented 4 days ago

Depends on #84

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)