Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonNorthey92 committed Feb 26, 2024
1 parent f0e12a4 commit 926e2b8
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions e2e/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestFullNetwork(t *testing.T) {
"-rpcuser=user",
"-rpcpassword=password",
"generatetoaddress",
"300", // need to generate a lot for greater chance to not spend coinbase
"1000", // need to generate a lot for greater chance to not spend coinbase
btcAddress.EncodeAddress(),
})
if err != nil {
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestFullNetwork(t *testing.T) {
go func() {
// create a new block every second, then view pop payouts and finalities

firstL2Keystone := hemi.L2KeystoneAbbreviate(l2Keystone).Serialize()
keystones := []hemi.L2Keystone{l2Keystone}

for {
l2KeystoneRequest := bssapi.L2KeystoneRequest{
Expand Down Expand Up @@ -251,20 +251,17 @@ func TestFullNetwork(t *testing.T) {

time.Sleep(1 * time.Second)

err = bssapi.Write(ctx, bws.conn, "someotherid", bssapi.PopPayoutsRequest{
L2BlockForPayout: firstL2Keystone[:],
})
if err != nil {
t.Logf("error: %s", err)
return
}

err = bssapi.Write(ctx, bws.conn, "someotheridz", bssapi.BTCFinalityByRecentKeystonesRequest{
NumRecentKeystones: 100,
})
if err != nil {
t.Logf("error: %s", err)
return
// check each keystone created to see if one made it into the bitcoin
// chain
for _, keystone := range keystones {
ks := hemi.L2KeystoneAbbreviate(keystone).Serialize()
err = bssapi.Write(ctx, bws.conn, "someotherid", bssapi.PopPayoutsRequest{
L2BlockForPayout: ks[:],
})
if err != nil {
t.Logf("error: %s", err)
return
}
}
}
}()
Expand Down

0 comments on commit 926e2b8

Please sign in to comment.