Skip to content

Commit

Permalink
Merge pull request #144 from centrifuge/fix-u256-lookup-index
Browse files Browse the repository at this point in the history
substrate: Update the lookup index for u256 field override
  • Loading branch information
cdamian authored Aug 12, 2024
2 parents c30dc0b + 9159288 commit 2a29dad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chains/substrate/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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: &registry.ValueDecoder[types.U256]{},
}

Expand Down

0 comments on commit 2a29dad

Please sign in to comment.