oracle: add MinimumResponseGas to interop

It's important for users of oracle contract.
This commit is contained in:
Roman Khimov 2021-04-06 22:23:11 +03:00
parent ed358b4c4c
commit 555693d8b8
2 changed files with 7 additions and 1 deletions

View file

@ -90,7 +90,7 @@ func TestCryptoLibNamedCurve(t *testing.T) {
require.EqualValues(t, native.Secp256r1, crypto.Secp256r1)
}
func TestOracleResponseCodes(t *testing.T) {
func TestOracleContractValues(t *testing.T) {
require.EqualValues(t, oracle.Success, transaction.Success)
require.EqualValues(t, oracle.ProtocolNotSupported, transaction.ProtocolNotSupported)
require.EqualValues(t, oracle.ConsensusUnreachable, transaction.ConsensusUnreachable)
@ -100,6 +100,8 @@ func TestOracleResponseCodes(t *testing.T) {
require.EqualValues(t, oracle.ResponseTooLarge, transaction.ResponseTooLarge)
require.EqualValues(t, oracle.InsufficientFunds, transaction.InsufficientFunds)
require.EqualValues(t, oracle.Error, transaction.Error)
require.EqualValues(t, oracle.MinimumResponseGas, native.MinimumResponseGas)
}
type nativeTestCase struct {

View file

@ -28,6 +28,10 @@ const (
// Hash represents Oracle contract hash.
const Hash = "\x58\x87\x17\x11\x7e\x0a\xa8\x10\x72\xaf\xab\x71\xd2\xdd\x89\xfe\x7c\x4b\x92\xfe"
// MinimumResponseGas is the minimum response fee permitted for request (that is
// you can't attach less than that to your request). It's 0.1 GAS at the moment.
const MinimumResponseGas = 10_000_000
// Request makes an oracle request. It can only be successfully invoked by
// deployed contract and it takes the following parameters:
//