Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

substrate: Update the lookup index for u256 field override #144

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading