コード例 #1
0
        public EthApiService(IClient client, ITransactionManager transactionManager) : base(client)
        {
            Client = client;

            ChainId         = new EthChainId(client);
            Accounts        = new EthAccounts(client);
            CoinBase        = new EthCoinBase(client);
            GasPrice        = new EthGasPrice(client);
            GetBalance      = new EthGetBalance(client);
            GetCode         = new EthGetCode(client);
            GetStorageAt    = new EthGetStorageAt(client);
            ProtocolVersion = new EthProtocolVersion(client);
            Sign            = new EthSign(client);
            Syncing         = new EthSyncing(client);

            Transactions = new EthApiTransactionsService(client);
            Filters      = new EthApiFilterService(client);
            Blocks       = new EthApiBlockService(client);
            Uncles       = new EthApiUncleService(client);
            Mining       = new EthApiMiningService(client);
            Compile      = new EthApiCompilerService(client);

            DefaultBlock              = BlockParameter.CreateLatest();
            TransactionManager        = transactionManager;
            TransactionManager.Client = client; //Ensure is the same
        }
コード例 #2
0
        public Eth(RpcClient client) : base(client)
        {
            this.Client = client;



            DeployContract = new DeployContract(client);

            Accounts        = new EthAccounts(client);
            CoinBase        = new EthCoinBase(client);
            GasPrice        = new EthGasPrice(client);
            GetBalance      = new EthGetBalance(client);
            GetCode         = new EthGetCode(client);
            GetStorageAt    = new EthGetStorageAt(client);
            ProtocolVersion = new EthProtocolVersion(client);
            Sign            = new EthSign(client);
            Syncing         = new EthSyncing(client);

            Transactions = new EthTransactionsService(client);
            Filters      = new EthFilterService(client);
            Blocks       = new EthBlockService(client);
            Uncles       = new EthUncleService(client);
            Mining       = new EthMiningService(client);
            Compile      = new EthCompilerService(client);

            this.DefaultBlock = BlockParameter.CreateLatest();
        }
コード例 #3
0
ファイル: Eth.cs プロジェクト: ffabrizio/Nethereum
        public Eth(RpcClient client):base(client)
        {
            this.Client = client;
           
           

            DeployContract = new DeployContract(client);

            Accounts = new EthAccounts(client);
            CoinBase = new EthCoinBase(client);
            GasPrice = new EthGasPrice(client);
            GetBalance = new EthGetBalance(client);
            GetCode = new EthGetCode(client);
            GetStorageAt = new EthGetStorageAt(client);       
            ProtocolVersion = new EthProtocolVersion(client);
            Sign = new EthSign(client);
            Syncing = new EthSyncing(client);

            Transactions = new EthTransactionsService(client);
            Filters = new EthFilterService(client);
            Blocks = new EthBlockService(client);
            Uncles = new EthUncleService(client);
            Mining = new EthMiningService(client);
            Compile = new EthCompilerService(client);

            this.DefaultBlock = BlockParameter.CreateLatest();

        }
コード例 #4
0
        public IEnumerable <string> Get()
        {
            var client      = new RpcClient(new Uri("http://172.19.0.3:8545"));
            var ethAccounts = new EthAccounts(client);
            var accounts    = ethAccounts.SendRequestAsync().Result;

            Logger.Debug($"Enviroment:{Environment.MachineName}. Method:{MethodBase.GetCurrentMethod().Name}.");
            return(new string[] { "value1", "value2" });
        }
コード例 #5
0
 public async void ShouldInterceptNoParamsRequest()
 {
     var client = new RpcClient(new Uri("http://localhost:8545/"));
   
     client.OverridingRequestInterceptor = new OverridingInterceptorMock();
     var ethAccounts = new EthAccounts(client);
     var accounts = await ethAccounts.SendRequestAsync();
     Assert.True(accounts.Length == 2);
     Assert.Equal(accounts[0],"hello");
 }
コード例 #6
0
        public async void ShouldInterceptNoParamsRequest()
        {
            var client = new HttpClient(new Uri("http://localhost:8545/"), defaultTimeOutForTests);

            client.OverridingRequestInterceptor = new OverridingInterceptorMock();
            var ethAccounts = new EthAccounts(client);
            var accounts    = await ethAccounts.SendRequestAsync();

            Assert.True(accounts.Length == 2);
            Assert.Equal("hello", accounts[0]);
        }
コード例 #7
0
        public override async Task <string[]> ExecuteAsync(IClient client)
        {
            var ethAccounts = new EthAccounts(client);

            return(await ethAccounts.SendRequestAsync());
        }
コード例 #8
0
 public async Task<dynamic> ExecuteTestAsync(RpcClient client)
 {
     var ethAccounts = new EthAccounts(client);
     return await ethAccounts.SendRequestAsync();
 }
コード例 #9
0
        public async Task <dynamic> ExecuteTestAsync(RpcClient client)
        {
            var ethAccounts = new EthAccounts(client);

            return(await ethAccounts.SendRequestAsync());
        }