diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 728a1db..2d04929 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -3,14 +3,14 @@ describe Ethereum do describe 'HttpClient' do it 'should work' do - client = Ethereum::HttpClient.new('localhost', '8545') + client = Ethereum::HttpClient.new('localhost', ENV['ETH_HTTP_PORT']) expect(client.eth_accounts['error']).to eq(nil) end end describe 'IpcClient' do before(:each) do - @client = Ethereum::IpcClient.new("#{ENV['HOME']}/EtherDev/data/geth.ipc") + @client = Ethereum::IpcClient.new(ENV['ETH_IPC_PATH']) end it 'should work' do diff --git a/spec/ethereum_spec.rb b/spec/ethereum_spec.rb index c930683..01291d8 100644 --- a/spec/ethereum_spec.rb +++ b/spec/ethereum_spec.rb @@ -3,48 +3,46 @@ describe Ethereum do before(:all) do - @client = Ethereum::HttpClient.new("172.16.135.102", "8545") + @client = Ethereum::HttpClient.new("loclhost", ENV['ETH_HTTP_PORT']) @formatter = Ethereum::Formatter.new end describe "Ethereum Version" do it 'has a version number' do - expect(Ethereum::VERSION).to eq("0.4.90") + expect(Ethereum::VERSION).to eq("1.5.2") end end - - describe "Deployment" do - it "should deploy a contract with parameters" do - @init = Ethereum::Initializer.new("#{ENV['PWD']}/spec/fixtures/ContractWithParams.sol", @client) - @init.build_all - @contract_with_params = ContractWithParams.new - @coinbase = @contract_with_params.connection.coinbase["result"] - @contract_with_params.deploy_and_wait(60, @coinbase) - address = @contract_with_params.call_get_setting__ - expect(address).to eq(@coinbase) - end - - end - - - describe "Basic contract testing" do - - before(:all) do - @init = Ethereum::Initializer.new("#{ENV['PWD']}/spec/fixtures/SimpleNameRegistry.sol", @client) - @init.build_all - @simple_name_registry = SimpleNameRegistry.new - @simple_name_registry.deploy_and_wait(60) - end - - it "should perform a contract transaction, wait for its completion, return an Ethereum::Transaction object" do - tx = @simple_name_registry.transact_and_wait_register("0x5b6cb65d40b0e27fab87a2180abcab22174a2d45", "minter.contract.dgx") - expect(tx.class).to be(Ethereum::Transaction) - end - - it "should test a call_(Ethereum Contract Function)" do - expect(true).to be(true) - end - - end + # Disabled specs due to: "eth_compilers, eth_compileSolidity are gone in go-ethereum 1.6.0" + # https://github.com/ethereum/go-ethereum/issues/3793 + # describe "Deployment" do + # it "should deploy a contract with parameters" do + # @init = Ethereum::Initializer.new("#{ENV['PWD']}/spec/fixtures/ContractWithParams.sol", @client) + # @init.build_all + # @contract_with_params = ContractWithParams.new + # @coinbase = @contract_with_params.connection.coinbase["result"] + # @contract_with_params.deploy_and_wait(60, @coinbase) + # address = @contract_with_params.call_get_setting__ + # expect(address).to eq(@coinbase) + # end + # end + + + # describe "Basic contract testing" do + # before(:all) do + # @init = Ethereum::Initializer.new("#{ENV['PWD']}/spec/fixtures/SimpleNameRegistry.sol", @client) + # @init.build_all + # @simple_name_registry = SimpleNameRegistry.new + # @simple_name_registry.deploy_and_wait(60) + # end + + # it "should perform a contract transaction, wait for its completion, return an Ethereum::Transaction object" do + # tx = @simple_name_registry.transact_and_wait_register("0x5b6cb65d40b0e27fab87a2180abcab22174a2d45", "minter.contract.dgx") + # expect(tx.class).to be(Ethereum::Transaction) + # end + + # it "should test a call_(Ethereum Contract Function)" do + # expect(true).to be(true) + # end + # end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c7f3a02..f098dcb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,6 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'ethereum' require 'pry' + +ENV['ETH_HTTP_PORT'] ||= '8545' +ENV['ETH_IPC_PATH'] ||= "#{ENV['HOME']}/EtherDev/data/geth.ipc"