Skip to content

Commit 2a29dad

Browse files
authored
Merge pull request #144 from centrifuge/fix-u256-lookup-index
substrate: Update the lookup index for u256 field override
2 parents c30dc0b + 9159288 commit 2a29dad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

chains/substrate/chain.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ func checkBlockstore(bs *blockstore.Blockstore, startBlock uint64) (uint64, erro
6262
}
6363
}
6464

65+
const U256LookupIndex = 89
66+
6567
func InitializeChain(cfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, m *metrics.ChainMetrics) (*Chain, error) {
6668
kp, err := keystore.KeypairFromAddress(cfg.From, keystore.SubChain, cfg.KeystorePath, cfg.Insecure)
6769
if err != nil {
@@ -108,7 +110,7 @@ func InitializeChain(cfg *core.ChainConfig, logger log15.Logger, sysErr chan<- e
108110

109111
// u256 is represented as [u64;4]. We use this override to skip extra processing when decoding fields with this type.
110112
u256FieldOverride := registry.FieldOverride{
111-
FieldLookupIndex: 142,
113+
FieldLookupIndex: U256LookupIndex,
112114
FieldDecoder: &registry.ValueDecoder[types.U256]{},
113115
}
114116

0 commit comments

Comments
 (0)