public async Task LoadPrivateKeyCorrectTest()
        {
            var secret = NeblioTransactionHelpers.IsPrivateKeyValid(FakeDataGenerator.DefaultDto.AliceKeystr);

            Assert.NotNull(secret);
            Assert.Equal(FakeDataGenerator.DefaultDto.AliceKeystr, secret.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// Public constructor which loads the NBitcoin objects
        /// </summary>
        public CryptographyTestDto()
        {
            AliceSecret ??= NeblioTransactionHelpers.IsPrivateKeyValid(AliceKeystr);
            AliceBitcoinAddress ??= AliceSecret.PubKey.GetAddress(ScriptPubKeyType.Legacy, NeblioTransactionHelpers.Network);

            BobSecret ??= NeblioTransactionHelpers.IsPrivateKeyValid(BobKeystr);
            BobBitcoinAddress ??= BobSecret.PubKey.GetAddress(ScriptPubKeyType.Legacy, NeblioTransactionHelpers.Network);
            BobAddress ??= BobBitcoinAddress.ToString();
        }
Beispiel #3
0
        public void Privatekey_Valid_Test()
        {
            string privateKey = "TondMadekiw2kRcyeQsRtm1oQCucN8yU9rstqy2rtrW6y2JDRe29";
            var    key2       = NeblioTransactionHelpers.IsPrivateKeyValid(privateKey);

            //Assert
            Assert.NotNull(key2);

            Assert.Equal(key2.ToWif(), privateKey);
        }
Beispiel #4
0
        public void Privatekey_LessThan52_Test()
        {
            var key1 = NeblioTransactionHelpers.IsPrivateKeyValid("Test");

            Assert.Null(key1);
        }
Beispiel #5
0
        public void Privatekey_Empty_Test()
        {
            var key = NeblioTransactionHelpers.IsPrivateKeyValid("");

            Assert.Null(key);
        }