MCPcopy Create free account
hub / github.com/api3dao/airnode / scrub

Function scrub

packages/airnode-node/src/providers/state.ts:77–85  ·  view source on GitHub ↗
(state: ProviderState<T>)

Source from the content-addressed store, hash-verified

75}
76
77export function scrub<T>(state: ProviderState<T>): ProviderState<T> {
78 // The 'config' object can be quite large so we don't want to return it to the coordinator
79 // from each spawned worker function. Doing so would bloat the coordinator state
80 // unnecessarily. The coordinator already has access to the config object.
81 //
82 // The 'masterHDNode' and the 'provider' keys are class instances. These do not typically transfer
83 // well and are better off being re-instantiated with the 'refresh(state)' function.
84 return removeKeys(state, ['config', 'masterHDNode', 'provider']) as ProviderState<T>;
85}
86
87export function refresh<T extends EVMProviderState>(state: ProviderState<T>) {
88 if (state.settings.chainType === 'evm') {

Callers 1

Calls 1

removeKeysFunction · 0.90

Tested by

no test coverage detected