Skip to content

Commit

Permalink
fixup: Respond to josh's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
marun committed May 21, 2024
1 parent 665efee commit 020dec8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
3 changes: 1 addition & 2 deletions tests/antithesis/avalanchego/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ func main() {
},
}})
if err != nil {
log.Printf("failed to issue initial funding X-chain baseTx: %s", err)
return
log.Fatalf("failed to issue initial funding X-chain baseTx: %s", err)
}
log.Printf("issued initial funding X-chain baseTx %s in %s", baseTx.ID(), time.Since(baseStartTime))

Expand Down
1 change: 0 additions & 1 deletion tests/antithesis/init_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func InitBootstrapDB(network *tmpnet.Network, avalancheGoPath string, pluginDir
"",
avalancheGoPath,
pluginDir,
0, // nodeCount is 0 because nodes should already be configured for subnets
); err != nil {
return fmt.Errorf("failed to start network: %w", err)
}
Expand Down
3 changes: 1 addition & 2 deletions tests/antithesis/xsvm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ func main() {
},
)
if err != nil {
log.Printf("failed to issue initial funding transfer: %s", err)
return
log.Fatalf("failed to issue initial funding transfer: %s", err)
}
log.Printf("issued initial funding transfer %s in %s", transferTxStatus.TxID, time.Since(baseStartTime))

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Run only once in the first ginkgo process

nodes := tmpnet.NewNodesOrPanic(flagVars.NodeCount())
subnets := vms.XSVMSubnets(nodes...)
subnets := vms.XSVMSubnetsOrPanic(nodes...)
return e2e.NewTestEnvironment(
flagVars,
&tmpnet.Network{
Expand Down
10 changes: 7 additions & 3 deletions tests/e2e/vms/xsvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ var (
subnetBName = "xsvm-b"
)

func XSVMSubnets(nodes ...*tmpnet.Node) []*tmpnet.Subnet {
func XSVMSubnetsOrPanic(nodes ...*tmpnet.Node) []*tmpnet.Subnet {
key, err := secp256k1.NewPrivateKey()
if err != nil {
panic(err)
}
return []*tmpnet.Subnet{
subnet.NewXSVMOrPanic(subnetAName, nil /* key, will be generated */, nodes...),
subnet.NewXSVMOrPanic(subnetBName, nil /* key, will be generated */, nodes...),
subnet.NewXSVMOrPanic(subnetAName, key, nodes...),
subnet.NewXSVMOrPanic(subnetBName, key, nodes...),
}
}

Expand Down
8 changes: 0 additions & 8 deletions tests/fixture/subnet/xsvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ func NewXSVMOrPanic(name string, key *secp256k1.PrivateKey, nodes ...*tmpnet.Nod
panic("a subnet must be validated by at least one node")
}

if key == nil {
var err error
key, err = secp256k1.NewPrivateKey()
if err != nil {
panic(err)
}
}

genesisBytes, err := genesis.Codec.Marshal(genesis.CodecVersion, &genesis.Genesis{
Timestamp: time.Now().Unix(),
Allocations: []genesis.Allocation{
Expand Down

0 comments on commit 020dec8

Please sign in to comment.