Skip to content

Commit

Permalink
Attempt to fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Sep 28, 2023
1 parent 51f5d07 commit 15eae2e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/enclave/enclave_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const _testEnclavePublicKeyHex = "034d3b7e63a8bcd532ee3d1d6ecad9d67fca7821981a04
// _successfulRollupGasPrice can be deterministically calculated when evaluating the management smart contract.
// It should change only when there are changes to the smart contract or if the gas estimation algorithm is modified.
// Other changes would mean something is broken.
const _successfulRollupGasPrice = 336360
const _successfulRollupGasPrice = 336552

var _enclavePubKey *ecies.PublicKey

Expand Down
8 changes: 8 additions & 0 deletions go/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ type Config struct {
batchInterval string
rollupInterval string
l1ChainID int
obscuroGenesis string
}

func NewNodeConfig(opts ...Option) *Config {
defaultConfig := &Config{
batchInterval: "1s",
rollupInterval: "3s",
l1ChainID: 1337,
obscuroGenesis: "{}",
}

for _, opt := range opts {
Expand Down Expand Up @@ -323,3 +325,9 @@ func WithL1ChainID(i int) Option {
c.l1ChainID = i
}
}

func WithObscuroGenesis(g string) Option {
return func(c *Config) {
c.obscuroGenesis = g
}
}
1 change: 1 addition & 0 deletions integration/contractdeployer/contract_deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func createObscuroNetwork(t *testing.T, startPort int) {
ERC20ContractLib: ethereummock.NewERC20ContractLibMock(),
Wallets: wallets,
StartPort: startPort,
WithPrefunding: true,
}
simStats := stats.NewStats(simParams.NumberOfNodes)
obscuroNetwork := network.NewNetworkOfSocketNodes(wallets)
Expand Down
6 changes: 6 additions & 0 deletions integration/simulation/network/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func (n *networkOfSocketNodes) Create(simParams *params.SimParams, _ *stats.Stat
isInboundP2PDisabled = i == simParams.NodeWithInboundP2PDisabled
}

genesis := "{}"
if simParams.WithPrefunding {
genesis = ""
}

// create the nodes
nodes[i] = noderunner.NewInMemNode(
node.NewNodeConfig(
Expand All @@ -100,6 +105,7 @@ func (n *networkOfSocketNodes) Create(simParams *params.SimParams, _ *stats.Stat
node.WithLogLevel(4),
node.WithDebugNamespaceEnabled(true),
node.WithL1BlockTime(simParams.AvgBlockDuration),
node.WithObscuroGenesis(genesis),
),
)

Expand Down
1 change: 1 addition & 0 deletions integration/simulation/params/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type SimParams struct {

StoppingDelay time.Duration // How long to wait between injection and verification
NodeWithInboundP2PDisabled int
WithPrefunding bool
}

type L1SetupData struct {
Expand Down

0 comments on commit 15eae2e

Please sign in to comment.