functionFromSelector method

AbiFunctionFragment functionFromSelector(
  1. List<int> selectorBytes
)

Retrieves a function fragment from the contract ABI based from selector.

Implementation

AbiFunctionFragment functionFromSelector(List<int> selectorBytes) {
  final selector = selectorBytes.sublist(0, ABIConst.selectorLength);
  return functions.singleWhere(
      (element) => BytesUtils.bytesEqual(selector, element.selector));
}