Skip to content

Commit

Permalink
netivetest: migrate Oracle contract tests to neotest
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaShaleva committed Dec 10, 2021
1 parent 26f1628 commit 1378691
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/core/native_oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package core

import (
"errors"
"math"
"math/big"
"testing"

Expand Down Expand Up @@ -254,9 +253,3 @@ func TestOracle_Request(t *testing.T) {
})
})
}

func TestGetSetPrice(t *testing.T) {
bc := newTestChain(t)
testGetSet(t, bc, bc.contracts.Oracle.Hash, "Price",
native.DefaultOracleRequestPrice, 1, math.MaxInt64)
}
18 changes: 18 additions & 0 deletions pkg/nativetest/oracle_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package nativetest

import (
"math"
"testing"

"github.com/nspcc-dev/neo-go/pkg/core/native"
"github.com/nspcc-dev/neo-go/pkg/core/native/nativenames"
"github.com/nspcc-dev/neo-go/pkg/neotest"
)

func newOracleClient(t *testing.T) *neotest.ContractInvoker {
return newNativeClient(t, nativenames.Oracle)
}

func TestGetSetPrice(t *testing.T) {
testGetSet(t, newOracleClient(t), "Price", native.DefaultOracleRequestPrice, 1, math.MaxInt64)
}

0 comments on commit 1378691

Please sign in to comment.