Exclude snapshotted fields from being nilified

staking
Eduard Sachava 5 years ago committed by Victor Baranov
parent 9b968938bc
commit bd9c17d719
  1. 4
      apps/explorer/lib/explorer/chain/import/runner/staking_pools.ex
  2. 2
      apps/explorer/lib/explorer/chain/import/runner/staking_pools_delegators.ex

@ -134,8 +134,8 @@ defmodule Explorer.Chain.Import.Runner.StakingPools do
staked_ratio: fragment("EXCLUDED.staked_ratio"),
self_staked_amount: fragment("EXCLUDED.self_staked_amount"),
staked_amount: fragment("EXCLUDED.staked_amount"),
snapshotted_self_staked_amount: fragment("EXCLUDED.self_staked_amount"),
snapshotted_staked_amount: fragment("EXCLUDED.staked_amount"),
snapshotted_self_staked_amount: pool.snapshotted_self_staked_amount,
snapshotted_staked_amount: pool.snapshotted_staked_amount,
ban_reason: fragment("EXCLUDED.ban_reason"),
was_banned_count: fragment("EXCLUDED.was_banned_count"),
was_validator_count: fragment("EXCLUDED.was_validator_count"),

@ -106,7 +106,7 @@ defmodule Explorer.Chain.Import.Runner.StakingPoolsDelegators do
update: [
set: [
stake_amount: fragment("EXCLUDED.stake_amount"),
snapshotted_stake_amount: fragment("EXCLUDED.snapshotted_stake_amount"),
snapshotted_stake_amount: delegator.snapshotted_stake_amount,
ordered_withdraw: fragment("EXCLUDED.ordered_withdraw"),
max_withdraw_allowed: fragment("EXCLUDED.max_withdraw_allowed"),
max_ordered_withdraw_allowed: fragment("EXCLUDED.max_ordered_withdraw_allowed"),

Loading…
Cancel
Save