checkSignature method
Returns whether the function has the expected selector.
This is used in an assert in the generated code.
Implementation
@protected
bool checkSignature(ContractFunction function, String expected) {
  return bytesToHex(function.selector) == expected;
}