fix style issues

pull/2264/head
Ayrat Badykov 5 years ago
parent 1af13f88f3
commit ea1f7f7c3d
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/explorer/lib/explorer/chain/smart_contract.ex
  2. 8
      apps/explorer/lib/explorer/chain/smart_contract/external_library.ex
  3. 4
      apps/explorer/priv/repo/migrations/20190709103104_add_external_libraries_to_smart_contracts.exs

@ -213,7 +213,7 @@ defmodule Explorer.Chain.SmartContract do
field(:constructor_arguments, :string) field(:constructor_arguments, :string)
field(:evm_version, :string) field(:evm_version, :string)
field(:optimization_runs, :integer) field(:optimization_runs, :integer)
embeds_many :external_libraries, ExternalLibrary embeds_many(:external_libraries, ExternalLibrary)
field(:abi, {:array, :map}) field(:abi, {:array, :map})
has_many( has_many(

@ -1,8 +1,12 @@
defmodule Explorer.Chain.SmartContract.ExternalLibrary do defmodule Explorer.Chain.SmartContract.ExternalLibrary do
@moduledoc """
The representation of an external library that was used for a smart contract.
"""
use Ecto.Schema use Ecto.Schema
embedded_schema do embedded_schema do
field :name field(:name)
field :address_hash field(:address_hash)
end end
end end

@ -3,11 +3,11 @@ defmodule Explorer.Repo.Migrations.AddExternalLibrariesToSmartContracts do
def change do def change do
alter table(:smart_contracts) do alter table(:smart_contracts) do
remove :external_libraries remove(:external_libraries)
end end
alter table(:smart_contracts) do alter table(:smart_contracts) do
add :external_libraries, {:array, :map}, default: [] add(:external_libraries, {:array, :map}, default: [])
end end
end end
end end

Loading…
Cancel
Save