MyCrypto/common/sagas/ens/helpers.ts
HenryNguyen5 c340246ca0 Enable no-implicit-any (#1263)
* Progress commit

* Update more types

* Fix more types

* Fix abi function types

* Fix lib types

* Fix rest of types

* Address wbobeirne changes

* Change origin and destination check
2018-03-07 17:36:05 -06:00

18 lines
547 B
TypeScript

import { select, apply, call } from 'redux-saga/effects';
import { INode } from 'libs/nodes/INode';
import { getNodeLib } from 'selectors/config';
import { SagaIterator } from 'redux-saga';
interface Params {
to: any;
data: any;
decoder: any;
}
export function* makeEthCallAndDecode({ to, data, decoder }: Params): SagaIterator {
const node: INode = yield select(getNodeLib);
const result: string = yield apply(node, node.sendCallRequest, [{ data, to }]);
const decodedResult = yield call(decoder, result);
return decodedResult;
}