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