diba-io / bitmask-core

Core functionality for the BitMask wallet
https://bitmask.app
Other
95 stars 21 forks source link

Test Suite for Wasm32 #337

Closed crisdut closed 1 year ago

crisdut commented 1 year ago

Description

For help troubleshooting in wasm32 target, I add support to regtest operations in wasm32 target.

How this works

Now, when we up the bitmaskd server if "regtest" flag, the server enables two new routes:

This allows us to simulate use cases of the web-wallet and extensions wallet.

For more details, see the tests/rgb/web/transfers.rs file.

Also, this PR solves all issues related to transfers between web-wallets.

crisdut commented 1 year ago

. Does this also include some bugfixes?

Yes, I worked closely with @josediegorobles on some issues related to transfers on the wasm32 destination:

  1. bad-txns-inputs-missingorspent The error was occurred because prefetch is not defined correctly in full_transfer method. (fixed)
  2. The script is invalid: derived scriptPubkey does not match transaction scriptPubkey The error occurs when you try spend contract with more than one input, each with tweak (tapret). (fixed)
  3. Some issues related BME

Also, Thanks to the new endpoints, I was able to reproduce all the steps in BME on BMC, as you can see here: https://github.com/diba-io/bitmask-core/pull/337/files#diff-f110b43ee23dce915a3b9f8a78373477bdc05c4cfa6dc8c79544c0d7825cfb53R1-R434