Exemplo n.º 1
0
        public void ShouldCreateAccount()
        {
            IHDWallet <CardanoWallet> hdWallet = new CardanoHDWallet("conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch", "");

            var account0 = hdWallet.GetAccount(0);

            var depositWallet0 = account0.GetExternalWallet(0);

            Assert.AreEqual("547ad18a1e3e3e3d4ff10b23e47e6795e180a18b213a1c894909cb5bf6d47f6c", depositWallet0.PublicKey.ToHexString());

            var depositWallet1 = account0.GetExternalWallet(1);

            Assert.AreEqual("d081709b367a8cb21d6ebb3b7ee40a4069f15d38e3a6db595ae0df8c7e86c9ed", depositWallet1.PublicKey.ToHexString());

            var account1        = hdWallet.GetAccount(1);
            var depositWallet10 = account1.GetExternalWallet(0);

            Assert.AreEqual("575f47e7ebbab331c83b5ce69ee8baa469d0eb18404627dc7659ab44400a1810", depositWallet10.PublicKey.ToHexString());
        }
Exemplo n.º 2
0
        public void ShouldGenerateInternalFromMnemonic(int accountIndex, int walletIndex, string expectedPrivateKey, string expectedPublicKey)
        {
            IHDWallet <CardanoWallet> hdWallet = new CardanoHDWallet(mnemonic, string.Empty);
            CardanoWallet             wallet   = hdWallet.GetAccount((uint)accountIndex).GetInternalWallet((uint)walletIndex);

            string pubKey  = $"00{wallet.PublicKey.ToHexString()}";
            string privKey = wallet.PrivateKey.ToHexString();

            Assert.AreEqual(expectedPrivateKey, privKey);
            Assert.AreEqual(expectedPublicKey, pubKey);
        }