examples: use interop equality helpers where possible

This commit is contained in:
Anna Shaleva 2022-07-11 17:29:25 +03:00
parent c0186f8224
commit 079f68a8c3
5 changed files with 11 additions and 10 deletions

View file

@ -26,7 +26,8 @@ func FilteredRequest(url string, filter []byte) {
func OracleCallback(url string, data interface{}, code int, res []byte) {
// This function shouldn't be called directly, we only expect oracle native
// contract to be calling it.
if string(runtime.GetCallingScriptHash()) != oracle.Hash {
callingHash := runtime.GetCallingScriptHash()
if !callingHash.Equals(oracle.Hash) {
panic("not called from oracle contract")
}
if code != oracle.Success {