Esempio n. 1
0
        public void Generate4SequnetialMultisigRecievingAndChangeAddress()
        {
            string[] receiving = { "rbAxG3vTMCuVMWppaobvTajBtUHSiFtkr5", "roLKXofxDFrkZqW7kU9aD7j7E6pTajEe16", "rjmcR79w6MatNK3KeHR3FvaEEHngdAKa9h", "reD6MyXPFUaJpyBtJVDgdYf7iN4qHbhzBz" };
            string[] change    = { "rXh3PVYpn462fDTAmLiUyKZ1aTWdzr4W9J", "rjNVcwuXKW1d8j8CQbxK4Kim5Hkg7Z4ZhL", "rginUKQEG9XjQVfhJ5ho7P4v9ENrtvF8Uk", "rgeVtHemGFGQzRU2Dhj3gYTgsWcjg4wgG5" };

            WalletMultisig wallet = new WalletMultisig(this.Network);
            var            root   = new AccountRootMultisig
            {
                CoinType = COINTYPE
            };

            wallet.AccountsRoot.Add(root);
            var account = wallet.AddNewAccount(this.multisigScheme, COINTYPE, DateTimeOffset.UtcNow);

            for (int i = 0; i < receiving.Length; i++)
            {
                Script redeemScript = account.GeneratePublicKey(i, this.Network);
                Assert.Equal(receiving[i], redeemScript.Hash.GetAddress(this.Network).ToString());
            }

            for (int i = 0; i < change.Length; i++)
            {
                Script redeemScript = account.GeneratePublicKey(i, this.Network, true);
                Assert.Equal(change[i], redeemScript.Hash.GetAddress(this.Network).ToString());
            }
        }
Esempio n. 2
0
        public void Generate1stMultisigAddress()
        {
            WalletMultisig wallet = new WalletMultisig(this.Network);
            var            root   = new AccountRootMultisig
            {
                CoinType = COINTYPE
            };

            wallet.AccountsRoot.Add(root);
            var account = wallet.AddNewAccount(this.multisigScheme, COINTYPE, DateTimeOffset.UtcNow);

            Script redeemScript = account.GeneratePublicKey(0, this.Network);

            Assert.Equal("rbAxG3vTMCuVMWppaobvTajBtUHSiFtkr5", redeemScript.Hash.GetAddress(this.Network).ToString());
        }