Skip to content

validateLoadStateParams

validateLoadStateParams(action): InvalidRequestError[]

Validates the parameters for loading the state into the VM.

Parameters

action: LoadStateParams<boolean>

The parameters for the load state action.

Returns

InvalidRequestError[]

  • An array of errors, if any.

Example

import { validateLoadStateParams } from 'tevm/actions'
const params = { state: {...} }
const errors = validateLoadStateParams(params)
if (errors.length > 0) {
console.error('Validation errors:', errors)
}

Defined in

packages/actions/src/LoadState/validateLoadStateParams.js:26