@@ -19,7 +19,8 @@ func Test_ChannelDefinitions_Serialization(t *testing.T) {
1919 ],
2020 "opts": null,
2121 "tombstone": false,
22- "source": 1
22+ "source": 1,
23+ "allowNilStreamValues": false
2324 },
2425 "1": {
2526 "reportFormat": "evm_premium_legacy",
@@ -35,7 +36,8 @@ func Test_ChannelDefinitions_Serialization(t *testing.T) {
3536 "baseUSDFee": "0.1"
3637 },
3738 "tombstone": false,
38- "source": 2
39+ "source": 2,
40+ "allowNilStreamValues": true
3941 }
4042}`
4143 var channelDefinitions ChannelDefinitions
@@ -132,6 +134,22 @@ func Test_ChannelDefinition_Equals(t *testing.T) {
132134 assert .False (t , a .Equals (b ))
133135 })
134136
137+ t .Run ("different AllowNilStreamValues" , func (t * testing.T ) {
138+ a := ChannelDefinition {
139+ ReportFormat : ReportFormatJSON ,
140+ Streams : []Stream {{0 , AggregatorMedian }, {1 , AggregatorMode }},
141+ Opts : nil ,
142+ AllowNilStreamValues : false ,
143+ }
144+ b := ChannelDefinition {
145+ ReportFormat : ReportFormatJSON ,
146+ Streams : []Stream {{0 , AggregatorMedian }, {1 , AggregatorMode }},
147+ Opts : nil ,
148+ AllowNilStreamValues : true ,
149+ }
150+ assert .False (t , a .Equals (b ))
151+ })
152+
135153 t .Run ("equal" , func (t * testing.T ) {
136154 a := ChannelDefinition {
137155 ReportFormat : ReportFormatJSON ,
@@ -190,16 +208,18 @@ func Test_ChannelDefinitions_Value(t *testing.T) {
190208 t .Run ("valid JSON" , func (t * testing.T ) {
191209 c := ChannelDefinitions {
192210 0 : {
193- ReportFormat : ReportFormatJSON ,
194- Streams : []Stream {{1 , AggregatorMedian }, {2 , AggregatorMode }},
195- Opts : nil ,
196- Source : 1 ,
211+ ReportFormat : ReportFormatJSON ,
212+ Streams : []Stream {{1 , AggregatorMedian }, {2 , AggregatorMode }},
213+ Opts : nil ,
214+ Source : 1 ,
215+ AllowNilStreamValues : false ,
197216 },
198217 1 : {
199- ReportFormat : ReportFormatEVMPremiumLegacy ,
200- Streams : []Stream {{1 , AggregatorMedian }, {2 , AggregatorMedian }, {3 , AggregatorQuote }},
201- Opts : []byte (`{"baseUSDFee":"0.1","expirationWindow":86400,"feedId":"0x0003aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","multiplier":"1000000000000000000"}` ),
202- Source : 2 ,
218+ ReportFormat : ReportFormatEVMPremiumLegacy ,
219+ Streams : []Stream {{1 , AggregatorMedian }, {2 , AggregatorMedian }, {3 , AggregatorQuote }},
220+ Opts : []byte (`{"baseUSDFee":"0.1","expirationWindow":86400,"feedId":"0x0003aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","multiplier":"1000000000000000000"}` ),
221+ Source : 2 ,
222+ AllowNilStreamValues : true ,
203223 },
204224 }
205225 v , err := c .Value ()
@@ -213,7 +233,8 @@ func Test_ChannelDefinitions_Value(t *testing.T) {
213233 ],
214234 "opts": null,
215235 "tombstone": false,
216- "source": 1
236+ "source": 1,
237+ "allowNilStreamValues": false
217238 },
218239 "1": {
219240 "reportFormat": "evm_premium_legacy",
@@ -229,7 +250,8 @@ func Test_ChannelDefinitions_Value(t *testing.T) {
229250 "multiplier": "1000000000000000000"
230251 },
231252 "tombstone": false,
232- "source": 2
253+ "source": 2,
254+ "allowNilStreamValues": true
233255 }
234256}`
235257 assert .JSONEq (t , expectedJSON , string (v .([]byte )))
0 commit comments