(state: ProviderState<T>)
| 75 | } |
| 76 | |
| 77 | export 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 | |
| 87 | export function refresh<T extends EVMProviderState>(state: ProviderState<T>) { |
| 88 | if (state.settings.chainType === 'evm') { |
no test coverage detected