예제 #1
0
        public async Task CanCompleteSignIn()
        {
            var keyPair = KeyPair.FromRandom("ed25519");
            await _keyStore.SetKeyAsync("networkId", "pending_key" + keyPair.GetPublicKey().ToString(), keyPair);

            var url = "http://example.com/location?account_id=near.account&public_key=" + keyPair.GetPublicKey().ToString();
            await _walletAccount.CompleteSignIn(url);

            Assert.AreEqual((await _keyStore.GetKeyAsync("networkId", "near.account")).ToString(), keyPair.ToString());
            Assert.IsTrue(_walletAccount.IsSignedIn());
            Assert.AreEqual("near.account", _walletAccount.GetAccountId());
        }