native: allow to set oracle request price

This commit is contained in:
Evgeniy Stratonikov 2021-03-05 14:38:16 +03:00
parent 27fc28bd69
commit 256cd09228
4 changed files with 84 additions and 6 deletions

View file

@ -14,3 +14,13 @@ func Request(url string, filter []byte, cb string, userData interface{}, gasForR
contract.States|contract.AllowNotify,
url, filter, cb, userData, gasForResponse)
}
// GetPrice represents `getPrice` method of Oracle native contract.
func GetPrice() int {
return contract.Call(interop.Hash160(Hash), "getPrice", contract.ReadStates).(int)
}
// SetPrice represents `setPrice` method of Oracle native contract.
func SetPrice(amount int) {
contract.Call(interop.Hash160(Hash), "setPrice", contract.States, amount)
}