예제 #1
0
        public async Task CreateKeysFromTransientTest()
        {
            var(_, keyPairSender) = await _api.KeysCreatePreloadTestCoinsAsync(_preloadInitialAmount);

            // transient keys, not persisted on the network
            var keyPairRecipient = await _api.GenerateKeyPairAsync();

            // we expect keyPairRecipient to persisted with
            // this call, and newKeyPair to be empty.
            var(xorUrl, newKeyPair) = await _api.CreateKeysAsync(
                keyPairSender.SK,
                _transferAmount,
                keyPairRecipient.PK);

            Assert.IsEmpty(newKeyPair.SK);
            Assert.IsNotNull(newKeyPair.PK);
            Assert.AreEqual(keyPairRecipient.PK, newKeyPair.PK);

            await Validate.PersistedKeyPair(xorUrl, keyPairRecipient, _api);

            var senderBalance = await _api.KeysBalanceFromSkAsync(keyPairSender.SK);

            Validate.IsEqualAmount("0.999999999", senderBalance);

            var recipientBalance = await _api.KeysBalanceFromSkAsync(keyPairRecipient.SK);

            Validate.IsEqualAmount(_transferAmount, recipientBalance);
        }
예제 #2
0
        public async Task CreateKeysTest()
        {
            var(_, keyPairSender) = await _api.KeysCreatePreloadTestCoinsAsync(_preloadInitialAmount);

            var(xorUrl, newKeyPair) = await _api.CreateKeysAsync(
                keyPairSender.SK,
                _transferAmount,
                null);

            await Validate.PersistedKeyPair(xorUrl, newKeyPair, _api);

            var senderBalance = await _api.KeysBalanceFromSkAsync(newKeyPair.SK);

            Validate.IsEqualAmount(_transferAmount, senderBalance);

            var recipientBalance = await _api.KeysBalanceFromSkAsync(newKeyPair.SK);

            Validate.IsEqualAmount(_transferAmount, recipientBalance);
        }
예제 #3
0
        public async Task KeysCreatePreloadTestCoinsTest()
        {
            var(xorUrl, keyPair) = await _api.KeysCreatePreloadTestCoinsAsync(_preloadAmount);

            await Validate.PersistedKeyPair(xorUrl, keyPair, _api);
        }