public void LatestIrreversibleBlock() { Nebulas.Neb neb = new Neb(new HttpRequest(_host)); var result = neb.API.LatestIrreversibleBlockAsync().Result; Assert.IsNotNull(result.Result.ChainId); }
public void NewAccountTest() { var account = Account.NewAccount(); string _host = "https://testnet.nebulas.io"; string from = account.GetAddressString(); ////string from, string to, string value, string nonce, int gasPrice, int gasLimit, string function,string args string to = "n22TK8fuUGbMGFKZTWus7a2R3a24uhr1NaQ"; string value = "0"; string nonce = "0"; int gasPrice = 1000000; int gasLimit = 2000000; string function = "getIntegralByPage"; string args = "[]"; Nebulas.Neb neb = new Neb(new HttpRequest(_host)); dynamic result = neb.API.CallAsync(from, to, value, nonce, gasPrice, gasLimit, function, args).Result; Assert.IsNotNull(result.result.result.Value); Assert.IsNotNull(account.GetAddressString()); Assert.IsNotNull(account.GetPrivateKey()); Assert.IsNotNull(account.GetPrivateKeyString()); Assert.IsNotNull(account.GetPublicKeyString()); }
public void GetAccountState() { Nebulas.Neb neb = new Neb(new HttpRequest(_host)); var result = neb.API.GetAccountStateAsync(from).Result; Assert.IsNotNull(result.Result.Balance); }
public void GetNebState() { Nebulas.Neb neb = new Neb(new HttpRequest(_host)); var result = neb.API.GetNebStateAsync().Result; Assert.IsNotNull(result.Result.ChainId); }
public void GetTransactionReceiptAsync() { Nebulas.Neb neb = new Neb(new HttpRequest(_host)); var result = neb.API.GetTransactionReceiptAsync("ef2308cb962188481f879c159117fbd08bb7e3e1cf56f0163ab21c7ec31930cc").Result; Assert.IsNotNull(result.Result); }
public void TestGetEventsByHash() { Neb neb = new Neb(); var result = neb.GetEventsByHash(TEST_TXHASH); Assert.IsTrue(result.message == string.Empty); }
public void TestGetTransactionReceipt() { Neb neb = new Neb(); var result = neb.GetTransactionReceipt(TEST_TXHASH); Assert.IsTrue(result.message == string.Empty); }
public void TestGetBlockByHeight() { Neb neb = new Neb(); var result = neb.GetBlockByHeight(415520, true); Assert.IsTrue(result.message == string.Empty); }
public void TestGetBlockByHash() { Neb neb = new Neb(); var result = neb.GetBlockByHash(TEST_HASH, true); Assert.IsTrue(result.message == string.Empty); }
public void TestGetLatestIrreversibleBlock() { Neb neb = new Neb(); var result = neb.LatestIrreversibleBlock(); Assert.IsTrue(result.message == string.Empty); }
public void TestGetNebState() { Neb neb = new Neb(); var result = neb.GetNebState(); Assert.IsTrue(result.message == string.Empty); }
public void TestGetTransactionByContract() { Neb neb = new Neb(); var result = neb.GetTransactionByContract(TEST_CONTRACT_ADDRESS); Assert.IsTrue(result.message == string.Empty); }
public void TestEstimateGas() { Neb neb = new Neb(true); var result = neb.EstimateGas(TESTNET_ACCOUNT, TESTNET_ACCOUNT1, "10000000000000", 1000, "1000000", "2000000"); Assert.IsTrue(result.message == string.Empty); }
public void TestGetAccountState() { Neb neb = new Neb(); string strAddress = "n1Z6SbjLuAEXfhX1UJvXT6BB5osWYxVg3F3"; var result = neb.GetAccountState(strAddress); Assert.IsTrue(result.message == string.Empty); }
public void TestSimulateCall() { //http://inty.co#u2355c Neb neb = new Neb(); ContractInfo contractInfo = new ContractInfo(); contractInfo.function = "get"; contractInfo.args = "[\"u2355c\"]"; var result = neb.SimulateCall(TEST_CONTRACT_ADDRESS, contractInfo); Assert.IsTrue(result.message == string.Empty); }
public void Subscribe() { Nebulas.Neb neb = new Neb(new HttpRequest(_host)); string temp = ""; neb.API.Subscribe(new string[] { "chain.linkBlock", "chain.pendingTransaction", "chain.transactionResult" }, (s) => { temp = s; }); while (string.IsNullOrEmpty(temp)) { Thread.Sleep(100); } }
public void Call() { //string from, string to, string value, string nonce, int gasPrice, int gasLimit, string function,string args string to = "n22TK8fuUGbMGFKZTWus7a2R3a24uhr1NaQ"; string value = "0"; string nonce = "0"; int gasPrice = 1000000; int gasLimit = 2000000; string function = "getIntegralByPage"; string args = "[]"; Nebulas.Neb neb = new Neb(new HttpRequest(_host)); dynamic result = neb.API.CallAsync(from, to, value, nonce, gasPrice, gasLimit, function, args).Result; }
public void EstimateGasAsync() { RequestEstimateGas request = new RequestEstimateGas() { From = from, To = "n1o5DKJefXgFNLhUTXRiJFFrTp2npgSuhvW", Value = "0", Nonce = "0", GasPrice = "1000000", GasLimit = "2000000" }; Nebulas.Neb neb = new Neb(new HttpRequest(_host)); var result = neb.API.EstimateGasAsync(request).Result; Assert.IsNotNull(result.Result); }