From 9159288e4d522b90f3e748224cbe17a7de0d483f Mon Sep 17 00:00:00 2001 From: Cosmin Damian <17934949+cdamian@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:56:11 +0300 Subject: [PATCH] substrate: Update the lookup index for u256 field override --- chains/substrate/chain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chains/substrate/chain.go b/chains/substrate/chain.go index ceaf4dd2..43e80221 100644 --- a/chains/substrate/chain.go +++ b/chains/substrate/chain.go @@ -62,6 +62,8 @@ func checkBlockstore(bs *blockstore.Blockstore, startBlock uint64) (uint64, erro } } +const U256LookupIndex = 89 + func InitializeChain(cfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, m *metrics.ChainMetrics) (*Chain, error) { kp, err := keystore.KeypairFromAddress(cfg.From, keystore.SubChain, cfg.KeystorePath, cfg.Insecure) if err != nil { @@ -108,7 +110,7 @@ func InitializeChain(cfg *core.ChainConfig, logger log15.Logger, sysErr chan<- e // u256 is represented as [u64;4]. We use this override to skip extra processing when decoding fields with this type. u256FieldOverride := registry.FieldOverride{ - FieldLookupIndex: 142, + FieldLookupIndex: U256LookupIndex, FieldDecoder: ®istry.ValueDecoder[types.U256]{}, }