Exemplo n.º 1
0
def switchEnv(newEnvName, do, cli, checkIfWalletRestored=False,
              restoredWalletKeyName=None, restoredIdentifiers=0):
    walletFilePath = getActiveWalletFilePath(cli)
    _connectTo(newEnvName, do, cli)

    # check wallet should have been persisted
    checkWalletFilePersisted(walletFilePath)

    if checkIfWalletRestored:
        checkWalletRestored(cli, restoredWalletKeyName, restoredIdentifiers)
Exemplo n.º 2
0
def testSaveWallet(do, be, cli):
    be(cli)
    assert cli._activeWallet is None
    createNewKey(do, cli, keyringName="Default")
    saveAndAssertKeyring(do, "Default")
    filePath = getWalletFilePath(cli.getContextBasedKeyringsBaseDir(),
                                 cli.walletFileName)

    checkPermissions(cli.getKeyringsBaseDir(), cli.config.KEYRING_DIR_MODE)
    checkPermissions(cli.getContextBasedKeyringsBaseDir(),
                     cli.config.KEYRING_DIR_MODE)
    checkWalletFilePersisted(filePath)
    checkPermissions(filePath, cli.config.KEYRING_FILE_MODE)