tendermint/flutter

Wrong signature causes the loadWallet functionality to break.

Closed this issue · 4 comments

If we save any bool variable in the shared preference the app template functionality breaks.

I dig into it and found that the PlainDataStore class contains a method Future<Either<CredentialsStorageFailure, Map<String, String?>>>. Since shared preference can contain an integer, bool, and double too. If we store any of these types of variables this method returns an error.

To Reproduce
Steps to reproduce the behavior:

  1. Store a variable of type int using shared preference. It will break and the loadWalletMethod will throw an error.

Expected behavior

  1. User should be able to get saved wallets.

What sort of bool you want to save? I think you should save anything in shared preferences using the plugin directly and not using this function

@wal33d006 the problem is that the shared preferences used directly by the app shares the same prefs as the PlainDataStore. we'll need to think about either introduce separate, namedSharedPrefs, or prefix each key stored in the prefs and work only on those with the prefix, while ignoring everything else

Ohh, I see!

@kjawadDeveloper1 due to the way sharedPreferences work in flutter, I've introduced a small, breaking change inside the transaction_signing_gateway #182 that causes all items stored inside PlainDataStore to be "wiped out", so updating the dependency will make all wallets saved in the app disappear. Let me know if this is a deal-breaker on your side