exthereum/blockchain

Compilation error in file lib/blockchain/contract.ex

pdobacz opened this issue · 2 comments

Hi!

I tried to run this, but I'm getting:

user@ubuntu:~/sources/elixir_tut/test_exthereum$ mix deps.compile blockchain
==> blockchain
Compiling 17 files (.ex)

== Compilation error in file lib/blockchain/contract.ex ==
** (KeyError) key :contract_interface not found in: %EVM.ExecEnv{account_interface: {{:., [line: 231], [Blockchain.Interface.AccountInterface, :new]}, [line: 231], []}, address: {:contract_address, [line: 222], nil}, block_interface: {{:., [line: 230], [Blockchain.Interface.BlockInterface, :new]}, [line: 230], [{:block_header, [line: 230], nil}, {:db, [line: 230], nil}]}, data: {:<<>>, [line: 225], []}, gas_price: {:gas_price, [line: 224], nil}, machine_code: {:init_code, [line: 228], nil}, originator: {:originator, [line: 223], nil}, sender: {:sender, [line: 226], nil}, stack_depth: {:stack_depth, [line: 229], nil}, value_in_wei: {:endowment, [line: 227], nil}}
    (stdlib) :maps.update(:contract_interface, {{:., [line: 232], [Blockchain.Interface.ContractInterface, :new]}, [line: 232], []}, %EVM.ExecEnv{account_interface: {{:., [line: 231], [Blockchain.Interface.AccountInterface, :new]}, [line: 231], []}, address: {:contract_address, [line: 222], nil}, block_interface: {{:., [line: 230], [Blockchain.Interface.BlockInterface, :new]}, [line: 230], [{:block_header, [line: 230], nil}, {:db, [line: 230], nil}]}, data: {:<<>>, [line: 225], []}, gas_price: {:gas_price, [line: 224], nil}, machine_code: {:init_code, [line: 228], nil}, originator: {:originator, [line: 223], nil}, sender: {:sender, [line: 226], nil}, stack_depth: {:stack_depth, [line: 229], nil}, value_in_wei: {:endowment, [line: 227], nil}})
    lib/evm/exec_env.ex:16: anonymous fn/2 in EVM.ExecEnv.__struct__/1
    (elixir) lib/enum.ex:1811: Enum."-reduce/3-lists^foldl/2-0-"/3
    expanding struct: EVM.ExecEnv.__struct__/1
    lib/blockchain/contract.ex:221: Blockchain.Contract.create_contract_exec_env/9
could not compile dependency :blockchain, "mix compile" failed. You can recompile this dependency with "mix deps.compile blockchain", update it with "mix deps.update blockchain" or clean it with "mix deps.clean blockchain"

The steps I took were:

  1. mix new
  2. add dependency ( [{:blockchain, "~> 0.1.5"}] )
  3. mix deps.get
  4. compile libsec... as in the README.md (I think it succeeded, after requiring me to install some missing debs)
  5. mix compile in root dir

I'm on

Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help)

Am I missing something?

Looks like we had a regression on 0.1.5 due to a dep incompatibility. Just pushed 0.1.6 which should fix your problem. Let me know if this works.

yep, compilation succeeds now, thanks!