fix: Fetch contract methods decoding candidates sorted by inserted_at (#10529)

* Fetch contract methods decoding candidates sorted by inserted_at

* Add contract_methods inserted_at B-tree index
vb-nft-collection-trigger-metadata-refetch-admin-api-endpoint
Victor Baranov 4 months ago committed by GitHub
parent 25339b9479
commit 0f7aba6337
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      apps/explorer/lib/explorer/chain/contract_method.ex
  2. 7
      apps/explorer/priv/repo/migrations/20240806162644_add_contract_methods_inserted_at_index.exs

@ -72,6 +72,7 @@ defmodule Explorer.Chain.ContractMethod do
from( from(
contract_method in __MODULE__, contract_method in __MODULE__,
where: contract_method.identifier == ^method_id, where: contract_method.identifier == ^method_id,
order_by: [asc: contract_method.inserted_at],
limit: ^limit limit: ^limit
) )
end end

@ -0,0 +1,7 @@
defmodule Explorer.Repo.Migrations.AddContractMethodsInsertedAtIndex do
use Ecto.Migration
def change do
create(index(:contract_methods, [:inserted_at]))
end
end
Loading…
Cancel
Save