Пример #1
0
        public override WalletAccount CreateAccount(UInt160 scriptHash)
        {
            MyWalletAccount account = new MyWalletAccount(scriptHash);

            AddAccount(account);
            return(account);
        }
Пример #2
0
        public void TestGetWatchOnly()
        {
            MyWalletAccount walletAccount = new MyWalletAccount(UInt160.Zero);

            walletAccount.WatchOnly.Should().BeTrue();
            walletAccount.Contract = new Contract();
            walletAccount.WatchOnly.Should().BeFalse();
        }
Пример #3
0
        public override WalletAccount CreateAccount(Contract contract, KeyPair key = null)
        {
            MyWalletAccount account = new MyWalletAccount(contract.ScriptHash)
            {
                Contract = contract
            };

            account.SetKey(key);
            AddAccount(account);
            return(account);
        }
Пример #4
0
        public override WalletAccount CreateAccount(byte[] privateKey)
        {
            KeyPair key = new KeyPair(privateKey);

            Neo.Wallets.SQLite.VerificationContract contract = new Neo.Wallets.SQLite.VerificationContract
            {
                Script        = Contract.CreateSignatureRedeemScript(key.PublicKey),
                ParameterList = new[] { ContractParameterType.Signature }
            };
            MyWalletAccount account = new MyWalletAccount(contract.ScriptHash);

            account.SetKey(key);
            account.Contract = contract;
            AddAccount(account);
            return(account);
        }
Пример #5
0
        public void TestGetAddress()
        {
            MyWalletAccount walletAccount = new MyWalletAccount(UInt160.Zero);

            walletAccount.Address.Should().Be("NKuyBkoGdZZSLyPbJEetheRhMjeznFZszf");
        }
Пример #6
0
        public void TestGetAddress()
        {
            MyWalletAccount walletAccount = new MyWalletAccount(UInt160.Zero);

            walletAccount.Address.Should().Be("AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM");
        }