Пример #1
0
        public void TestImportScriptHashWalletIsNotOpened()
        {
            var mockWalletManager = GetAWalletManagerWithoutAnWallet();
            // Act
            NEP6Account walletAccount1 = (NEP6Account)mockWalletManager.CreateAccount(_defaultPassword);

            mockWalletManager = new Nep6WalletManager(new FileWrapper(), new JsonConverterWrapper());
            NEP6Account walletAccount2 = (NEP6Account)mockWalletManager.ImportScriptHash(walletAccount1.ScriptHash);
        }
Пример #2
0
        public void TestDeleteAccountWalletIsNotOpened()
        {
            var            mockWalletManager = GetAWalletManagerWithoutAnWallet();
            IWalletAccount walletAccount     = mockWalletManager.CreateAccount(_defaultPassword);

            Assert.IsTrue(mockWalletManager.Wallet.Accounts.ToList().Count == 1);

            mockWalletManager = new Nep6WalletManager(new FileWrapper(), new JsonConverterWrapper());
            mockWalletManager.DeleteAccount(walletAccount.Contract.ScriptHash);
        }
Пример #3
0
        public void TestGetAccountPublicKeyWalletIsNotOpened()
        {
            var mockWalletManager = GetAWalletManagerWithoutAnWallet();
            // Act
            IWalletAccount walletAccount = mockWalletManager.ImportWif("KxLNhtdXXqaYUW1DKBc1XYQLxhouxXPLgQhR8kk7SYG3ajjR8M8a", _defaultPassword);

            byte[]  privateKey = GetPrivateKeyFromWIF("KxLNhtdXXqaYUW1DKBc1XYQLxhouxXPLgQhR8kk7SYG3ajjR8M8a");
            ECPoint publicKey  = new ECPoint(Crypto.Default.ComputePublicKey(privateKey, true));

            mockWalletManager = new Nep6WalletManager(new FileWrapper(), new JsonConverterWrapper());
            IWalletAccount walletAccount2 = mockWalletManager.GetAccount(publicKey);
        }