The motivation to change this part of the deprecated wallet-wasm
library was the simple introduction of testnet address support in
yoroi-mobile. The alternative is to migrate all of yoroi-mobile away to
use the new cardano-wallet module, but this would be significant work
in comparison and can be delayed. Directly adapting
react-native-cardano to use cardano-wallet was not feasible either
as the API is quite different and would be exceptionally awkward to try
and force into the react-native-cardano API that was built on top of
wallet-wasm with its API in mind.
Only xwallet_account() was changed, as the other function lacking
support for testnet, wallet_public_to_address() does not seem to be used
anywhere in react-native-cardano, which was the motivation for this change.
Changing wallet_public_to_address() would also be more difficult as it
requires a hard API change or an additional function to allow
overloading.
On the other hand, xwallet_account() supports a JSON API,
which conveniently allows us to be backwards compatible, as the absence
of the protocol_magic field will revert to the previous behavior of
default (mainnet) protocol magic.
Additionally, the rust-cardano dependency here was updated as verification of
testnet addresses was not working properly in the very old of rust-cardano that was used.
The motivation to change this part of the deprecated
wallet-wasm
library was the simple introduction of testnet address support in yoroi-mobile. The alternative is to migrate all of yoroi-mobile away to use the newcardano-wallet
module, but this would be significant work in comparison and can be delayed. Directly adaptingreact-native-cardano
to usecardano-wallet
was not feasible either as the API is quite different and would be exceptionally awkward to try and force into thereact-native-cardano
API that was built on top ofwallet-wasm
with its API in mind.Only
xwallet_account()
was changed, as the other function lacking support for testnet,wallet_public_to_address()
does not seem to be used anywhere inreact-native-cardano
, which was the motivation for this change. Changingwallet_public_to_address()
would also be more difficult as it requires a hard API change or an additional function to allow overloading.On the other hand,
xwallet_account()
supports a JSON API, which conveniently allows us to be backwards compatible, as the absence of theprotocol_magic
field will revert to the previous behavior of default (mainnet) protocol magic.Additionally, the
rust-cardano
dependency here was updated as verification of testnet addresses was not working properly in the very old ofrust-cardano
that was used.