Skip to content

Commit dac5f5d

Browse files
authored
chore: make format golines (#409)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 2dc1903 commit dac5f5d

File tree

3 files changed

+65
-17
lines changed

3 files changed

+65
-17
lines changed

filter/chainsync/chainsync_test.go

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ type mockStakeDeregistrationCert struct {
207207

208208
func (m *mockStakeDeregistrationCert) Cbor() []byte { return m.cborData }
209209

210-
func mockStakeCredentialValue(credType uint, hashBytes []byte) common.Credential {
210+
func mockStakeCredentialValue(
211+
credType uint,
212+
hashBytes []byte,
213+
) common.Credential {
211214
var credHash common.CredentialHash
212215
copy(credHash[:], hashBytes)
213216
return common.Credential{
@@ -216,7 +219,10 @@ func mockStakeCredentialValue(credType uint, hashBytes []byte) common.Credential
216219
}
217220
}
218221

219-
func mockStakeCredentialPtr(credType uint, hashBytes []byte) *common.Credential {
222+
func mockStakeCredentialPtr(
223+
credType uint,
224+
hashBytes []byte,
225+
) *common.Credential {
220226
cred := mockStakeCredentialValue(credType, hashBytes)
221227
return &cred
222228
}
@@ -329,7 +335,9 @@ func TestFilterByPolicyId(t *testing.T) {
329335
policyId := policyIdHash // Use the same hash as the filter
330336

331337
// Create a new MultiAsset with pre-populated data
332-
assetsData := make(map[common.Blake2b224]map[cbor.ByteString]common.MultiAssetTypeOutput)
338+
assetsData := make(
339+
map[common.Blake2b224]map[cbor.ByteString]common.MultiAssetTypeOutput,
340+
)
333341
assetName := cbor.NewByteString([]byte("asset1"))
334342
assetsData[policyId] = map[cbor.ByteString]common.MultiAssetTypeOutput{
335343
assetName: 1, // Add asset with quantity 1
@@ -360,7 +368,12 @@ func TestFilterByPolicyId(t *testing.T) {
360368
// Wait for the event to be processed
361369
select {
362370
case filteredEvt := <-cs.OutputChan():
363-
assert.Equal(t, evt, filteredEvt, "Filtered event should match the input event")
371+
assert.Equal(
372+
t,
373+
evt,
374+
filteredEvt,
375+
"Filtered event should match the input event",
376+
)
364377
case <-time.After(5 * time.Second):
365378
t.Fatal("Test timed out waiting for filtered event")
366379
}
@@ -375,7 +388,9 @@ func TestFilterByAssetFingerprint(t *testing.T) {
375388
policyId := common.Blake2b224Hash([]byte("policy1"))
376389

377390
// Create a new MultiAsset with pre-populated data
378-
assetsData := make(map[common.Blake2b224]map[cbor.ByteString]common.MultiAssetTypeOutput)
391+
assetsData := make(
392+
map[common.Blake2b224]map[cbor.ByteString]common.MultiAssetTypeOutput,
393+
)
379394
assetName := cbor.NewByteString([]byte("asset1"))
380395
assetsData[policyId] = map[cbor.ByteString]common.MultiAssetTypeOutput{
381396
assetName: 1, // Add asset with quantity 1
@@ -406,7 +421,12 @@ func TestFilterByAssetFingerprint(t *testing.T) {
406421
// Wait for the event to be processed
407422
select {
408423
case filteredEvt := <-cs.OutputChan():
409-
assert.Equal(t, evt, filteredEvt, "Filtered event should match the input event")
424+
assert.Equal(
425+
t,
426+
evt,
427+
filteredEvt,
428+
"Filtered event should match the input event",
429+
)
410430
case <-time.After(5 * time.Second):
411431
t.Fatal("Test timed out waiting for filtered event")
412432
}
@@ -434,7 +454,12 @@ func TestFilterByPoolId(t *testing.T) {
434454
// Wait for the event to be processed
435455
select {
436456
case filteredEvt := <-cs.OutputChan():
437-
assert.Equal(t, evt, filteredEvt, "Filtered event should match the input event")
457+
assert.Equal(
458+
t,
459+
evt,
460+
filteredEvt,
461+
"Filtered event should match the input event",
462+
)
438463
case <-time.After(5 * time.Second):
439464
t.Fatal("Test timed out waiting for filtered event")
440465
}

filter/chainsync/plugin_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212

1313
func TestPluginRegistration(t *testing.T) {
1414
// Retrieve the plugin entries
15-
plugins := plugin.GetPlugins(plugin.PluginTypeFilter) // Get all registered plugins
15+
plugins := plugin.GetPlugins(
16+
plugin.PluginTypeFilter,
17+
) // Get all registered plugins
1618

1719
// Find the "chainsync" plugin
1820
var p plugin.Plugin
@@ -80,7 +82,12 @@ func TestPluginEventProcessing(t *testing.T) {
8082
// Read the event from the output channel
8183
select {
8284
case outputEvent := <-p.OutputChan():
83-
assert.Equal(t, testEvent, outputEvent, "Output event should match input event")
85+
assert.Equal(
86+
t,
87+
testEvent,
88+
outputEvent,
89+
"Output event should match input event",
90+
)
8491
case <-time.After(1 * time.Second):
8592
t.Fatal("Timeout waiting for output event")
8693
}

input/chainsync/block_test.go

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,12 @@ func TestNewBlockContext(t *testing.T) {
127127
era: common.Era{
128128
Name: "Shelley",
129129
},
130-
hash: common.NewBlake2b256([]byte("sample-hash-shelley")),
131-
prevHash: common.NewBlake2b256([]byte("prev-hash-shelley")),
130+
hash: common.NewBlake2b256(
131+
[]byte("sample-hash-shelley"),
132+
),
133+
prevHash: common.NewBlake2b256(
134+
[]byte("prev-hash-shelley"),
135+
),
132136
blockBodySize: 1024,
133137
cborBytes: []byte{0x01, 0x02, 0x03},
134138
},
@@ -148,8 +152,12 @@ func TestNewBlockContext(t *testing.T) {
148152
era: common.Era{
149153
Name: "Allegra",
150154
},
151-
hash: common.NewBlake2b256([]byte("another-hash-allegra")),
152-
prevHash: common.NewBlake2b256([]byte("prev-hash-allegra")),
155+
hash: common.NewBlake2b256(
156+
[]byte("another-hash-allegra"),
157+
),
158+
prevHash: common.NewBlake2b256(
159+
[]byte("prev-hash-allegra"),
160+
),
153161
blockBodySize: 2048,
154162
cborBytes: []byte{0x04, 0x05, 0x06},
155163
},
@@ -169,8 +177,12 @@ func TestNewBlockContext(t *testing.T) {
169177
era: common.Era{
170178
Name: "Mary",
171179
},
172-
hash: common.NewBlake2b256([]byte("mary-block-hash")),
173-
prevHash: common.NewBlake2b256([]byte("prev-hash-mary")),
180+
hash: common.NewBlake2b256(
181+
[]byte("mary-block-hash"),
182+
),
183+
prevHash: common.NewBlake2b256(
184+
[]byte("prev-hash-mary"),
185+
),
174186
blockBodySize: 4096,
175187
cborBytes: []byte{0x07, 0x08, 0x09},
176188
},
@@ -249,8 +261,12 @@ func TestNewBlockContextEdgeCases(t *testing.T) {
249261
era: common.Era{
250262
Name: "Alonzo",
251263
},
252-
hash: common.NewBlake2b256([]byte("max-block-hash")),
253-
prevHash: common.NewBlake2b256([]byte("max-prev-hash")),
264+
hash: common.NewBlake2b256(
265+
[]byte("max-block-hash"),
266+
),
267+
prevHash: common.NewBlake2b256(
268+
[]byte("max-prev-hash"),
269+
),
254270
blockBodySize: ^uint64(0),
255271
cborBytes: []byte{0x0A, 0x0B, 0x0C},
256272
},

0 commit comments

Comments
 (0)