mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-10 08:08:16 -05:00
**Motivation**
Make the code transition for compatibility with the Bun.
**Description**
- The dependency `cpu-features` is not compatible with the `Bun`
- Removed the direct dependency
- Upgrade the `@chainsafe/persistent-merkle-tree` and `@chainsafe/ssz`
so the hasher detection is done implicitly.
- Latest commit for
[hahstree](e86a8b136a)
has the support for fallback, which is not used in the
`@chainsafe/persistent-merkle-tree`
**Steps to test or reproduce**
Run all tests
lodestar-state-transition
This package is part of ChainSafe's Lodestar project
The beacon state transition and state transition utilities
Usage
import {CachedBeaconStateAllForks, stateTransition} from "@lodestar/state-transition";
import {ssz} from "@lodestar/types";
import {generateState} from "../test/utils/state";
// dummy test state
const preState: CachedBeaconStateAllForks = generateState() as CachedBeaconStateAllForks;
// dummy test block
const block = ssz.phase0.SignedBeaconBlock.defaultValue();
// Run state transition on block
const postState = stateTransition(preState, block);
License
Apache-2.0 ChainSafe Systems