Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public void ShouldGenerateFromMnemonic()
        {
            CardanoHDWallet hdWallet = new CardanoHDWallet(mnemonic, string.Empty);

            Assert.AreEqual(ReferenceSeed, hdWallet.BIP39Seed);

            CardanoWallet wallet = hdWallet.GetCoinTypeWallet();

            Assert.AreEqual(ReferencePrivateKey, wallet.PrivateKey.ToHexString());
            Assert.AreEqual(ReferencePubKey, $"00{wallet.PublicKey.ToHexString()}");
        }