Skip to content

Commit ad864f3

Browse files
authored
Merge branch 'master' into update-bn2-automation
2 parents 1d47246 + a525801 commit ad864f3

File tree

4 files changed

+28
-31
lines changed

4 files changed

+28
-31
lines changed

engine/execution/computation/computer/computer_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
"github.com/onflow/flow-go/fvm/storage/testutils"
4040
"github.com/onflow/flow-go/fvm/systemcontracts"
4141
"github.com/onflow/flow-go/ledger"
42-
"github.com/onflow/flow-go/model/convert/fixtures"
4342
"github.com/onflow/flow-go/model/flow"
4443
"github.com/onflow/flow-go/module/epochs"
4544
"github.com/onflow/flow-go/module/executiondatasync/execution_data"
@@ -553,7 +552,7 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) {
553552
serviceEvents, err := systemcontracts.ServiceEventsForChain(execCtx.Chain.ChainID())
554553
require.NoError(t, err)
555554

556-
payload, err := json.Decode(nil, []byte(fixtures.EpochSetupFixtureJSON))
555+
payload, err := json.Decode(nil, []byte(unittest.EpochSetupFixtureJSON))
557556
require.NoError(t, err)
558557

559558
serviceEventA, ok := payload.(cadence.Event)
@@ -564,7 +563,7 @@ func TestBlockExecutor_ExecuteBlock(t *testing.T) {
564563
}
565564
serviceEventA.EventType.QualifiedIdentifier = serviceEvents.EpochSetup.QualifiedIdentifier()
566565

567-
payload, err = json.Decode(nil, []byte(fixtures.EpochCommitFixtureJSON))
566+
payload, err = json.Decode(nil, []byte(unittest.EpochCommitFixtureJSON))
568567
require.NoError(t, err)
569568

570569
serviceEventB, ok := payload.(cadence.Event)

model/convert/service_event_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"github.com/stretchr/testify/require"
88

99
"github.com/onflow/flow-go/model/convert"
10-
"github.com/onflow/flow-go/model/convert/fixtures"
1110
"github.com/onflow/flow-go/model/flow"
11+
"github.com/onflow/flow-go/utils/unittest"
1212
)
1313

1414
func TestEventConversion(t *testing.T) {
@@ -17,7 +17,7 @@ func TestEventConversion(t *testing.T) {
1717

1818
t.Run("epoch setup", func(t *testing.T) {
1919

20-
fixture, expected := fixtures.EpochSetupFixtureByChainID(chainID)
20+
fixture, expected := unittest.EpochSetupFixtureByChainID(chainID)
2121

2222
// convert Cadence types to Go types
2323
event, err := convert.ServiceEvent(chainID, fixture)
@@ -34,7 +34,7 @@ func TestEventConversion(t *testing.T) {
3434

3535
t.Run("epoch commit", func(t *testing.T) {
3636

37-
fixture, expected := fixtures.EpochCommitFixtureByChainID(chainID)
37+
fixture, expected := unittest.EpochCommitFixtureByChainID(chainID)
3838

3939
// convert Cadence types to Go types
4040
event, err := convert.ServiceEvent(chainID, fixture)

module/chunks/chunkVerifier_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/onflow/flow-go/ledger/complete/wal/fixtures"
2222
chunksmodels "github.com/onflow/flow-go/model/chunks"
2323
"github.com/onflow/flow-go/model/convert"
24-
convertfixtures "github.com/onflow/flow-go/model/convert/fixtures"
2524
"github.com/onflow/flow-go/model/flow"
2625
"github.com/onflow/flow-go/model/verification"
2726
"github.com/onflow/flow-go/module/chunks"
@@ -48,8 +47,8 @@ var eventsList = flow.EventsList{
4847

4948
// the chain we use for this test suite
5049
var testChain = flow.Emulator
51-
var epochSetupEvent, _ = convertfixtures.EpochSetupFixtureByChainID(testChain)
52-
var epochCommitEvent, _ = convertfixtures.EpochCommitFixtureByChainID(testChain)
50+
var epochSetupEvent, _ = unittest.EpochSetupFixtureByChainID(testChain)
51+
var epochCommitEvent, _ = unittest.EpochCommitFixtureByChainID(testChain)
5352

5453
var epochSetupServiceEvent, _ = convert.ServiceEvent(testChain, epochSetupEvent)
5554
var epochCommitServiceEvent, _ = convert.ServiceEvent(testChain, epochCommitEvent)
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
package fixtures
1+
package unittest
22

33
import (
44
"github.com/onflow/flow-go/crypto"
55
"github.com/onflow/flow-go/fvm/systemcontracts"
66
"github.com/onflow/flow-go/model/flow"
7-
"github.com/onflow/flow-go/utils/unittest"
87
)
98

109
// This file contains service event fixtures for testing purposes.
@@ -18,7 +17,7 @@ func EpochSetupFixtureByChainID(chain flow.ChainID) (flow.Event, *flow.EpochSetu
1817
panic(err)
1918
}
2019

21-
event := unittest.EventFixture(events.EpochSetup.EventType(), 1, 1, unittest.IdentifierFixture(), 0)
20+
event := EventFixture(events.EpochSetup.EventType(), 1, 1, IdentifierFixture(), 0)
2221
event.Payload = []byte(EpochSetupFixtureJSON)
2322

2423
// randomSource is [0,0,...,1,2,3,4]
@@ -50,56 +49,56 @@ func EpochSetupFixtureByChainID(chain flow.ChainID) (flow.Event, *flow.EpochSetu
5049
Role: flow.RoleCollection,
5150
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000001"),
5251
Address: "1.flow.com",
53-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
54-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
52+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
53+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
5554
Weight: 100,
5655
},
5756
{
5857
Role: flow.RoleCollection,
5958
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000002"),
6059
Address: "2.flow.com",
61-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
62-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
60+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
61+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
6362
Weight: 100,
6463
},
6564
{
6665
Role: flow.RoleCollection,
6766
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000003"),
6867
Address: "3.flow.com",
69-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
70-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
68+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
69+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
7170
Weight: 100,
7271
},
7372
{
7473
Role: flow.RoleCollection,
7574
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000004"),
7675
Address: "4.flow.com",
77-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
78-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
76+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "378dbf45d85c614feb10d8bd4f78f4b6ef8eec7d987b937e123255444657fb3da031f232a507e323df3a6f6b8f50339c51d188e80c0e7a92420945cc6ca893fc"),
77+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "af4aade26d76bb2ab15dcc89adcef82a51f6f04b3cb5f4555214b40ec89813c7a5f95776ea4fe449de48166d0bbc59b919b7eabebaac9614cf6f9461fac257765415f4d8ef1376a2365ec9960121888ea5383d88a140c24c29962b0a14e4e4e7"),
7978
Weight: 100,
8079
},
8180
{
8281
Role: flow.RoleConsensus,
8382
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000011"),
8483
Address: "11.flow.com",
85-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "cfdfe8e4362c8f79d11772cb7277ab16e5033a63e8dd5d34caf1b041b77e5b2d63c2072260949ccf8907486e4cfc733c8c42ca0e4e208f30470b0d950856cd47"),
86-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "8207559cd7136af378bba53a8f0196dee3849a3ab02897c1995c3e3f6ca0c4a776c3ae869d1ddbb473090054be2400ad06d7910aa2c5d1780220fdf3765a3c1764bce10c6fe66a5a2be51a422e878518bd750424bb56b8a0ecf0f8ad2057e83f"),
84+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "cfdfe8e4362c8f79d11772cb7277ab16e5033a63e8dd5d34caf1b041b77e5b2d63c2072260949ccf8907486e4cfc733c8c42ca0e4e208f30470b0d950856cd47"),
85+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "8207559cd7136af378bba53a8f0196dee3849a3ab02897c1995c3e3f6ca0c4a776c3ae869d1ddbb473090054be2400ad06d7910aa2c5d1780220fdf3765a3c1764bce10c6fe66a5a2be51a422e878518bd750424bb56b8a0ecf0f8ad2057e83f"),
8786
Weight: 100,
8887
},
8988
{
9089
Role: flow.RoleExecution,
9190
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000021"),
9291
Address: "21.flow.com",
93-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "d64318ba0dbf68f3788fc81c41d507c5822bf53154530673127c66f50fe4469ccf1a054a868a9f88506a8999f2386d86fcd2b901779718cba4fb53c2da258f9e"),
94-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "880b162b7ec138b36af401d07868cb08d25746d905395edbb4625bdf105d4bb2b2f4b0f4ae273a296a6efefa7ce9ccb914e39947ce0e83745125cab05d62516076ff0173ed472d3791ccef937597c9ea12381d76f547a092a4981d77ff3fba83"),
92+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "d64318ba0dbf68f3788fc81c41d507c5822bf53154530673127c66f50fe4469ccf1a054a868a9f88506a8999f2386d86fcd2b901779718cba4fb53c2da258f9e"),
93+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "880b162b7ec138b36af401d07868cb08d25746d905395edbb4625bdf105d4bb2b2f4b0f4ae273a296a6efefa7ce9ccb914e39947ce0e83745125cab05d62516076ff0173ed472d3791ccef937597c9ea12381d76f547a092a4981d77ff3fba83"),
9594
Weight: 100,
9695
},
9796
{
9897
Role: flow.RoleVerification,
9998
NodeID: flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000031"),
10099
Address: "31.flow.com",
101-
NetworkPubKey: unittest.MustDecodePublicKeyHex(crypto.ECDSAP256, "697241208dcc9142b6f53064adc8ff1c95760c68beb2ba083c1d005d40181fd7a1b113274e0163c053a3addd47cd528ec6a1f190cf465aac87c415feaae011ae"),
102-
StakingPubKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "b1f97d0a06020eca97352e1adde72270ee713c7daf58da7e74bf72235321048b4841bdfc28227964bf18e371e266e32107d238358848bcc5d0977a0db4bda0b4c33d3874ff991e595e0f537c7b87b4ddce92038ebc7b295c9ea20a1492302aa7"),
100+
NetworkPubKey: MustDecodePublicKeyHex(crypto.ECDSAP256, "697241208dcc9142b6f53064adc8ff1c95760c68beb2ba083c1d005d40181fd7a1b113274e0163c053a3addd47cd528ec6a1f190cf465aac87c415feaae011ae"),
101+
StakingPubKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "b1f97d0a06020eca97352e1adde72270ee713c7daf58da7e74bf72235321048b4841bdfc28227964bf18e371e266e32107d238358848bcc5d0977a0db4bda0b4c33d3874ff991e595e0f537c7b87b4ddce92038ebc7b295c9ea20a1492302aa7"),
103102
Weight: 100,
104103
},
105104
},
@@ -117,7 +116,7 @@ func EpochCommitFixtureByChainID(chain flow.ChainID) (flow.Event, *flow.EpochCom
117116
panic(err)
118117
}
119118

120-
event := unittest.EventFixture(events.EpochCommit.EventType(), 1, 1, unittest.IdentifierFixture(), 0)
119+
event := EventFixture(events.EpochCommit.EventType(), 1, 1, IdentifierFixture(), 0)
121120
event.Payload = []byte(EpochCommitFixtureJSON)
122121

123122
expected := &flow.EpochCommit{
@@ -128,19 +127,19 @@ func EpochCommitFixtureByChainID(chain flow.ChainID) (flow.Event, *flow.EpochCom
128127
flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000001"),
129128
flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000002"),
130129
},
131-
SigData: unittest.MustDecodeSignatureHex("b072ed22ed305acd44818a6c836e09b4e844eebde6a4fdbf5cec983e2872b86c8b0f6c34c0777bf52e385ab7c45dc55d"),
130+
SigData: MustDecodeSignatureHex("b072ed22ed305acd44818a6c836e09b4e844eebde6a4fdbf5cec983e2872b86c8b0f6c34c0777bf52e385ab7c45dc55d"),
132131
},
133132
{
134133
VoterIDs: []flow.Identifier{
135134
flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000003"),
136135
flow.MustHexStringToIdentifier("0000000000000000000000000000000000000000000000000000000000000004"),
137136
},
138-
SigData: unittest.MustDecodeSignatureHex("899e266a543e1b3a564f68b22f7be571f2e944ec30fadc4b39e2d5f526ba044c0f3cb2648f8334fc216fa3360a0418b2"),
137+
SigData: MustDecodeSignatureHex("899e266a543e1b3a564f68b22f7be571f2e944ec30fadc4b39e2d5f526ba044c0f3cb2648f8334fc216fa3360a0418b2"),
139138
},
140139
},
141-
DKGGroupKey: unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "8c588266db5f5cda629e83f8aa04ae9413593fac19e4865d06d291c9d14fbdd9bdb86a7a12f9ef8590c79cb635e3163315d193087e9336092987150d0cd2b14ac6365f7dc93eec573752108b8c12368abb65f0652d9f644e5aed611c37926950"),
140+
DKGGroupKey: MustDecodePublicKeyHex(crypto.BLSBLS12381, "8c588266db5f5cda629e83f8aa04ae9413593fac19e4865d06d291c9d14fbdd9bdb86a7a12f9ef8590c79cb635e3163315d193087e9336092987150d0cd2b14ac6365f7dc93eec573752108b8c12368abb65f0652d9f644e5aed611c37926950"),
142141
DKGParticipantKeys: []crypto.PublicKey{
143-
unittest.MustDecodePublicKeyHex(crypto.BLSBLS12381, "87a339e4e5c74f089da20a33f515d8c8f4464ab53ede5a74aa2432cd1ae66d522da0c122249ee176cd747ddc83ca81090498389384201614caf51eac392c1c0a916dfdcfbbdf7363f9552b6468434add3d3f6dc91a92bbe3ee368b59b7828488"),
142+
MustDecodePublicKeyHex(crypto.BLSBLS12381, "87a339e4e5c74f089da20a33f515d8c8f4464ab53ede5a74aa2432cd1ae66d522da0c122249ee176cd747ddc83ca81090498389384201614caf51eac392c1c0a916dfdcfbbdf7363f9552b6468434add3d3f6dc91a92bbe3ee368b59b7828488"),
144143
},
145144
}
146145

0 commit comments

Comments
 (0)