Skip to content

Commit

Permalink
fixing test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanschalm committed Nov 21, 2024
1 parent 8821639 commit fd270d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
3 changes: 2 additions & 1 deletion integration/tests/upgrades/protocol_version_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestProtocolVersionUpgrade(t *testing.T) {
}

func (suite *ProtocolVersionUpgradeSuite) SetupTest() {
suite.Suite.SetupTest()
// Begin the test with a v0 kvstore, rather than the default v1.
// This lets us test upgrading v0->v1
protocolState, err := suite.net.BootstrapSnapshot.ProtocolState()
Expand All @@ -37,7 +38,6 @@ func (suite *ProtocolVersionUpgradeSuite) SetupTest() {
suite.KVStoreFactory = func(epochStateID flow.Identifier) (protocol_state.KVStoreAPI, error) {
return kvstore.NewKVStoreV0(finalizationThreshold, epochExtensionViewCount, epochStateID)
}
suite.Suite.SetupTest()
}

// TestProtocolStateVersionUpgradeServiceEvent tests the process of upgrading the protocol
Expand Down Expand Up @@ -80,6 +80,7 @@ func (s *ProtocolVersionUpgradeSuite) TestProtocolStateVersionUpgradeServiceEven
// after an invalid protocol version upgrade event, we should still have a v0 kvstore
snapshot = s.AwaitSnapshotAtView(invalidUpgradeActiveView, time.Minute, 500*time.Millisecond)
actualProtocolVersion = snapshot.Encodable().SealingSegment.LatestProtocolStateEntry().KVStore.Version
// below line is failing, probably because we are starting with v0 now...
require.Equal(s.T(), INITIAL_PROTOCOL_VERSION, actualProtocolVersion, "should have v0 still after invalid upgrade")

// 2. Valid service event should cause a version upgrade
Expand Down
30 changes: 0 additions & 30 deletions integration/utils/templates/set-protocol-state-version.cdc

This file was deleted.

6 changes: 2 additions & 4 deletions integration/utils/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ var createAndSetupNodeTxScript string
//go:embed templates/remove-node.cdc
var removeNodeTxScript string

//go:embed templates/set-protocol-state-version.cdc
var setProtocolStateVersionScript string

func LocalnetEnv() templates.Environment {
return templates.Environment{
EpochAddress: "f8d6e0586b0a20c7",
Expand Down Expand Up @@ -195,8 +192,9 @@ func MakeSetProtocolStateVersionTx(
activeViewDiff uint64,
) (*sdk.Transaction, error) {
accountKey := adminAccount.Keys[adminAccountKeyID]

tx := sdk.NewTransaction().
SetScript([]byte(templates.ReplaceAddresses(setProtocolStateVersionScript, env))).
SetScript(templates.GenerateSetProtocolStateVersionScript(env)).
SetComputeLimit(9999).
SetReferenceBlockID(latestBlockID).
SetProposalKey(adminAccount.Address, adminAccountKeyID, accountKey.SequenceNumber).
Expand Down

0 comments on commit fd270d7

Please sign in to comment.