@@ -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"
@@ -95,7 +96,7 @@ func (s *AccountStatusesProviderSuite) TestAccountStatusesDataProvider_StateStre
95
96
nil ,
96
97
"dummy-id" ,
97
98
topic ,
98
- models .Arguments {},
99
+ wsmodels .Arguments {},
99
100
send ,
100
101
s .chain ,
101
102
state_stream .DefaultEventFilterConfig ,
@@ -114,7 +115,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
114
115
return []testType {
115
116
{
116
117
name : "SubscribeAccountStatusesFromStartBlockID happy path" ,
117
- arguments : models .Arguments {
118
+ arguments : wsmodels .Arguments {
118
119
"start_block_id" : s .rootBlock .ID ().String (),
119
120
"event_types" : []string {string (flow .EventAccountCreated )},
120
121
"account_addresses" : []string {unittest .AddressFixture ().String ()},
@@ -131,7 +132,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
131
132
},
132
133
{
133
134
name : "SubscribeAccountStatusesFromStartHeight happy path" ,
134
- arguments : models .Arguments {
135
+ arguments : wsmodels .Arguments {
135
136
"start_block_height" : strconv .FormatUint (s .rootBlock .Header .Height , 10 ),
136
137
"event_types" : []string {string (flow .EventAccountCreated )},
137
138
"account_addresses" : []string {unittest .AddressFixture ().String ()},
@@ -148,7 +149,7 @@ func (s *AccountStatusesProviderSuite) subscribeAccountStatusesDataProviderTestC
148
149
},
149
150
{
150
151
name : "SubscribeAccountStatusesFromLatestBlock happy path" ,
151
- arguments : models .Arguments {
152
+ arguments : wsmodels .Arguments {
152
153
"event_types" : []string {string (flow .EventAccountCreated )},
153
154
"account_addresses" : []string {unittest .AddressFixture ().String ()},
154
155
},
@@ -188,12 +189,10 @@ func (s *AccountStatusesProviderSuite) expectedAccountStatusesResponses(backendR
188
189
expectedResponses := make ([]interface {}, len (backendResponses ))
189
190
190
191
for i , resp := range backendResponses {
191
- var expectedResponsePayload models.AccountStatusesResponse
192
- expectedResponsePayload .Build (resp , uint64 (i ))
193
-
192
+ expectedResponsePayload := models .NewAccountStatusesResponse (resp , uint64 (i ))
194
193
expectedResponses [i ] = & models.BaseDataProvidersResponse {
195
194
Topic : AccountStatusesTopic ,
196
- Payload : & expectedResponsePayload ,
195
+ Payload : expectedResponsePayload ,
197
196
}
198
197
}
199
198
@@ -203,10 +202,6 @@ func (s *AccountStatusesProviderSuite) expectedAccountStatusesResponses(backendR
203
202
// TestAccountStatusesDataProvider_InvalidArguments tests the behavior of the account statuses data provider
204
203
// when invalid arguments are provided. It verifies that appropriate errors are returned
205
204
// for missing or conflicting arguments.
206
- // This test covers the test cases:
207
- // 1. Providing both 'start_block_id' and 'start_block_height' simultaneously.
208
- // 2. Invalid 'start_block_id' argument.
209
- // 3. Invalid 'start_block_height' argument.
210
205
func (s * AccountStatusesProviderSuite ) TestAccountStatusesDataProvider_InvalidArguments () {
211
206
send := make (chan interface {})
212
207
topic := AccountStatusesTopic
@@ -335,7 +330,7 @@ func invalidAccountStatusesArgumentsTestCases() []testErrType {
335
330
return []testErrType {
336
331
{
337
332
name : "provide both 'start_block_id' and 'start_block_height' arguments" ,
338
- arguments : models .Arguments {
333
+ arguments : wsmodels .Arguments {
339
334
"start_block_id" : unittest .BlockFixture ().ID ().String (),
340
335
"start_block_height" : fmt .Sprintf ("%d" , unittest .BlockFixture ().Header .Height ),
341
336
"event_types" : []string {state_stream .CoreEventAccountCreated },
0 commit comments