Esempio n. 1
0
        public static async Task <Near> SetUpTestConnection()
        {
            var keyStore = new InMemoryKeyStore();
            var key      = "ed25519:2wyRcSwSuHtRVmkMCGjPwnzZmQLeXLzLLyED1NDMt4BjnKgQL6tF85yBx6Jr26D2dUNeC716RBoTxntVHsegogYw";
            var keyPair  = KeyPair.FromString(key);
            await keyStore.SetKeyAsync(NetworkId, TestAccountName, keyPair);

            var environment = EnvironmentConfig.GetConfig(Environment.CI);
            var config      = new NearConfig()
            {
                NetworkId    = TestUtils.NetworkId,
                NodeUrl      = environment.NodeUrl.AbsoluteUri,
                ProviderType = ProviderType.JsonRpc,
                SignerType   = SignerType.InMemory,
                KeyStore     = keyStore,
                ContractName = "contractId",
                WalletUrl    = environment.NodeUrl.AbsoluteUri
            };

            return(await Near.ConnectAsync(config : config));
        }