mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
use hive_test for monero and wownero tests
This commit is contained in:
parent
23d2de26d7
commit
6e48fc4ea6
2 changed files with 36 additions and 16 deletions
|
@ -81,19 +81,29 @@ void main() async {
|
|||
if (Platform.isIOS) {
|
||||
appDir = (await getLibraryDirectory());
|
||||
}
|
||||
await Hive.close();
|
||||
Hive.init(appDir.path);
|
||||
Hive.registerAdapter(NodeAdapter());
|
||||
Hive.registerAdapter(WalletInfoAdapter());
|
||||
Hive.registerAdapter(WalletTypeAdapter());
|
||||
Hive.registerAdapter(UnspentCoinsInfoAdapter());
|
||||
|
||||
monero.onStartup();
|
||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||
walletService = monero.createMoneroWalletService(_walletInfoSource);
|
||||
|
||||
bool hiveAdaptersRegistered = false;
|
||||
|
||||
group("Mainnet tests", () {
|
||||
setUp(() async {
|
||||
await setUpTestHive();
|
||||
if (!hiveAdaptersRegistered) {
|
||||
hiveAdaptersRegistered = true;
|
||||
|
||||
Hive.registerAdapter(NodeAdapter());
|
||||
Hive.registerAdapter(WalletInfoAdapter());
|
||||
Hive.registerAdapter(WalletTypeAdapter());
|
||||
Hive.registerAdapter(UnspentCoinsInfoAdapter());
|
||||
|
||||
final wallets = await Hive.openBox('wallets');
|
||||
await wallets.put('currentWalletName', name);
|
||||
|
||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||
walletService = monero.createMoneroWalletService(_walletInfoSource);
|
||||
}
|
||||
|
||||
try {
|
||||
// if (name?.isEmpty ?? true) {
|
||||
// name = await generateName();
|
||||
|
|
|
@ -72,19 +72,29 @@ void main() async {
|
|||
if (Platform.isIOS) {
|
||||
appDir = (await getLibraryDirectory());
|
||||
}
|
||||
await Hive.close();
|
||||
Hive.init(appDir.path);
|
||||
Hive.registerAdapter(NodeAdapter());
|
||||
Hive.registerAdapter(WalletInfoAdapter());
|
||||
Hive.registerAdapter(WalletTypeAdapter());
|
||||
Hive.registerAdapter(UnspentCoinsInfoAdapter());
|
||||
|
||||
wownero.onStartup();
|
||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||
walletService = wownero.createWowneroWalletService(_walletInfoSource);
|
||||
|
||||
bool hiveAdaptersRegistered = false;
|
||||
|
||||
group("Wownero 14 word seed generation", () {
|
||||
setUp(() async {
|
||||
await setUpTestHive();
|
||||
if (!hiveAdaptersRegistered) {
|
||||
hiveAdaptersRegistered = true;
|
||||
|
||||
Hive.registerAdapter(NodeAdapter());
|
||||
Hive.registerAdapter(WalletInfoAdapter());
|
||||
Hive.registerAdapter(WalletTypeAdapter());
|
||||
Hive.registerAdapter(UnspentCoinsInfoAdapter());
|
||||
|
||||
final wallets = await Hive.openBox('wallets');
|
||||
await wallets.put('currentWalletName', name);
|
||||
|
||||
_walletInfoSource = await Hive.openBox<WalletInfo>(WalletInfo.boxName);
|
||||
walletService = wownero.createWowneroWalletService(_walletInfoSource);
|
||||
}
|
||||
|
||||
bool hasThrown = false;
|
||||
try {
|
||||
name = 'namee${Random().nextInt(10000000)}';
|
||||
|
|
Loading…
Reference in a new issue