1
- package access_test
1
+ package validator_test
2
2
3
3
import (
4
4
"context"
@@ -13,8 +13,8 @@ import (
13
13
14
14
jsoncdc "github.com/onflow/cadence/encoding/json"
15
15
16
- "github.com/onflow/flow-go/access"
17
16
accessmock "github.com/onflow/flow-go/access/mock"
17
+ "github.com/onflow/flow-go/access/validator"
18
18
"github.com/onflow/flow-go/fvm"
19
19
"github.com/onflow/flow-go/model/flow"
20
20
"github.com/onflow/flow-go/module"
@@ -32,7 +32,7 @@ type TransactionValidatorSuite struct {
32
32
blocks * accessmock.Blocks
33
33
header * flow.Header
34
34
chain flow.Chain
35
- validatorOptions access .TransactionValidationOptions
35
+ validatorOptions validator .TransactionValidationOptions
36
36
metrics module.TransactionValidationMetrics
37
37
}
38
38
@@ -57,8 +57,8 @@ func (s *TransactionValidatorSuite) SetupTest() {
57
57
Return (s .header , nil )
58
58
59
59
s .chain = flow .Testnet .Chain ()
60
- s .validatorOptions = access .TransactionValidationOptions {
61
- CheckPayerBalanceMode : access .EnforceCheck ,
60
+ s .validatorOptions = validator .TransactionValidationOptions {
61
+ CheckPayerBalanceMode : validator .EnforceCheck ,
62
62
MaxTransactionByteSize : flow .DefaultMaxTransactionByteSize ,
63
63
MaxCollectionByteSize : flow .DefaultMaxCollectionByteSize ,
64
64
}
@@ -97,7 +97,7 @@ func (s *TransactionValidatorSuite) TestTransactionValidator_ScriptExecutorInter
97
97
Return (nil , errors .New ("script executor internal error" )).
98
98
Once ()
99
99
100
- validator , err := access .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
100
+ validator , err := validator .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
101
101
assert .NoError (s .T (), err )
102
102
assert .NotNil (s .T (), validator )
103
103
@@ -128,7 +128,7 @@ func (s *TransactionValidatorSuite) TestTransactionValidator_SufficientBalance()
128
128
Return (actualResponse , nil ).
129
129
Once ()
130
130
131
- validator , err := access .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
131
+ validator , err := validator .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
132
132
assert .NoError (s .T (), err )
133
133
assert .NotNil (s .T (), validator )
134
134
@@ -164,7 +164,7 @@ func (s *TransactionValidatorSuite) TestTransactionValidator_InsufficientBalance
164
164
165
165
validateTx := func () error {
166
166
txBody := unittest .TransactionBodyFixture ()
167
- validator , err := access .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
167
+ validator , err := validator .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
168
168
assert .NoError (s .T (), err )
169
169
assert .NotNil (s .T (), validator )
170
170
@@ -174,15 +174,15 @@ func (s *TransactionValidatorSuite) TestTransactionValidator_InsufficientBalance
174
174
s .Run ("with enforce check" , func () {
175
175
err := validateTx ()
176
176
177
- expectedError := access .InsufficientBalanceError {
177
+ expectedError := validator .InsufficientBalanceError {
178
178
Payer : unittest .AddressFixture (),
179
179
RequiredBalance : requiredBalance ,
180
180
}
181
181
assert .ErrorIs (s .T (), err , expectedError )
182
182
})
183
183
184
184
s .Run ("with warn check" , func () {
185
- s .validatorOptions .CheckPayerBalanceMode = access .WarnCheck
185
+ s .validatorOptions .CheckPayerBalanceMode = validator .WarnCheck
186
186
err := validateTx ()
187
187
assert .NoError (s .T (), err )
188
188
})
@@ -198,7 +198,7 @@ func (s *TransactionValidatorSuite) TestTransactionValidator_SealedIndexedHeight
198
198
On ("IndexedHeight" ).
199
199
Return (indexedHeight , nil )
200
200
201
- validator , err := access .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
201
+ validator , err := validator .NewTransactionValidator (s .blocks , s .chain , s .metrics , s .validatorOptions , scriptExecutor )
202
202
assert .NoError (s .T (), err )
203
203
assert .NotNil (s .T (), validator )
204
204
0 commit comments