Merge pull request #1559 from poanetwork/ab-change-v-column-type

change v column type
pull/1613/head
Victor Baranov 6 years ago committed by GitHub
commit b07d57f682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/block_scout_web/test/block_scout_web/schema/query/address_test.exs
  2. 2
      apps/block_scout_web/test/block_scout_web/schema/query/transaction_test.exs
  3. 2
      apps/explorer/lib/explorer/chain/transaction.ex
  4. 15
      apps/explorer/priv/repo/migrations/20190313103912_change_transactions_v_column_type.exs

@ -215,7 +215,7 @@ defmodule BlockScoutWeb.Schema.Query.AddressTest do
"r" => to_string(transaction.r),
"s" => to_string(transaction.s),
"status" => nil,
"v" => transaction.v,
"v" => to_string(transaction.v),
"value" => to_string(transaction.value.value),
"from_address_hash" => to_string(transaction.from_address_hash),
"to_address_hash" => to_string(transaction.to_address_hash),

@ -55,7 +55,7 @@ defmodule BlockScoutWeb.Schema.Query.TransactionTest do
"r" => to_string(transaction.r),
"s" => to_string(transaction.s),
"status" => transaction.status |> to_string() |> String.upcase(),
"v" => transaction.v,
"v" => to_string(transaction.v),
"value" => to_string(transaction.value.value),
"from_address_hash" => to_string(transaction.from_address_hash),
"to_address_hash" => to_string(transaction.to_address_hash),

@ -202,7 +202,7 @@ defmodule Explorer.Chain.Transaction do
field(:r, :decimal)
field(:s, :decimal)
field(:status, Status)
field(:v, :integer)
field(:v, :decimal)
field(:value, Wei)
timestamps()

@ -0,0 +1,15 @@
defmodule Explorer.Repo.Migrations.ChangeTransactionsVColumnType do
use Ecto.Migration
def up do
alter table(:transactions) do
modify(:v, :numeric, precision: 100, null: false)
end
end
def down do
alter table(:transactions) do
modify(:v, :integer, null: false)
end
end
end
Loading…
Cancel
Save