@@ -12,7 +12,8 @@ import (
12
12
"github.com/stretchr/testify/require"
13
13
"github.com/stretchr/testify/suite"
14
14
15
- "github.com/onflow/flow-go/engine/access/rest/websockets/models"
15
+ "github.com/onflow/flow-go/engine/access/rest/websockets/data_providers/models"
16
+ wsmodels "github.com/onflow/flow-go/engine/access/rest/websockets/models"
16
17
"github.com/onflow/flow-go/engine/access/state_stream"
17
18
"github.com/onflow/flow-go/engine/access/state_stream/backend"
18
19
ssmock "github.com/onflow/flow-go/engine/access/state_stream/mock"
@@ -98,7 +99,7 @@ func (s *AccountStatusesProviderSuite) TestAccountStatusesDataProvider_StateStre
98
99
nil ,
99
100
"dummy-id" ,
100
101
topic ,
101
- models .Arguments {},
102
+ wsmodels .Arguments {},
102
103
send ,
103
104
s .chain ,
104
105
state_stream .DefaultEventFilterConfig ,
@@ -117,7 +118,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
117
118
return []testType {
118
119
{
119
120
name : "SubscribeAccountStatusesFromStartBlockID happy path" ,
120
- arguments : models .Arguments {
121
+ arguments : wsmodels .Arguments {
121
122
"start_block_id" : s .rootBlock .ID ().String (),
122
123
"event_types" : []string {string (flow .EventAccountCreated )},
123
124
"account_addresses" : []string {unittest .AddressFixture ().String ()},
@@ -134,7 +135,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
134
135
},
135
136
{
136
137
name : "SubscribeAccountStatusesFromStartHeight happy path" ,
137
- arguments : models .Arguments {
138
+ arguments : wsmodels .Arguments {
138
139
"start_block_height" : strconv .FormatUint (s .rootBlock .Header .Height , 10 ),
139
140
"event_types" : []string {string (flow .EventAccountCreated )},
140
141
"account_addresses" : []string {unittest .AddressFixture ().String ()},
@@ -151,7 +152,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
151
152
},
152
153
{
153
154
name : "SubscribeAccountStatusesFromLatestBlock happy path" ,
154
- arguments : models .Arguments {
155
+ arguments : wsmodels .Arguments {
155
156
"event_types" : []string {string (flow .EventAccountCreated )},
156
157
"account_addresses" : []string {unittest .AddressFixture ().String ()},
157
158
},
@@ -191,12 +192,10 @@ func (s *AccountStatusesProviderSuite) expectedAccountStatusesResponses(backendR
191
192
expectedResponses := make ([]interface {}, len (backendResponses ))
192
193
193
194
for i , resp := range backendResponses {
194
- var expectedResponsePayload models.AccountStatusesResponse
195
- expectedResponsePayload .Build (resp , uint64 (i ))
196
-
195
+ expectedResponsePayload := models .NewAccountStatusesResponse (resp , uint64 (i ))
197
196
expectedResponses [i ] = & models.BaseDataProvidersResponse {
198
197
Topic : AccountStatusesTopic ,
199
- Payload : & expectedResponsePayload ,
198
+ Payload : expectedResponsePayload ,
200
199
}
201
200
}
202
201
@@ -206,10 +205,6 @@ func (s *AccountStatusesProviderSuite) expectedAccountStatusesResponses(backendR
206
205
// TestAccountStatusesDataProvider_InvalidArguments tests the behavior of the account statuses data provider
207
206
// when invalid arguments are provided. It verifies that appropriate errors are returned
208
207
// for missing or conflicting arguments.
209
- // This test covers the test cases:
210
- // 1. Providing both 'start_block_id' and 'start_block_height' simultaneously.
211
- // 2. Invalid 'start_block_id' argument.
212
- // 3. Invalid 'start_block_height' argument.
213
208
func (s * AccountStatusesProviderSuite ) TestAccountStatusesDataProvider_InvalidArguments () {
214
209
ctx := context .Background ()
215
210
send := make (chan interface {})
@@ -342,7 +337,7 @@ func invalidAccountStatusesArgumentsTestCases() []testErrType {
342
337
return []testErrType {
343
338
{
344
339
name : "provide both 'start_block_id' and 'start_block_height' arguments" ,
345
- arguments : models .Arguments {
340
+ arguments : wsmodels .Arguments {
346
341
"start_block_id" : unittest .BlockFixture ().ID ().String (),
347
342
"start_block_height" : fmt .Sprintf ("%d" , unittest .BlockFixture ().Header .Height ),
348
343
"event_types" : []string {state_stream .CoreEventAccountCreated },
0 commit comments