forked from strangelove-ventures/interchaintest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add waiting bootsrapped state * add avalanche integration and add subnet creation * add implementation for subnet chains * move port binding allocation * deascrease block number for WaitForBlocks * dont send avax if subnets list is empty * revert image pulling
- Loading branch information
Showing
50 changed files
with
318 additions
and
4,887 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
chain/avalanche/utils/chain_id.go → chain/avalanche/lib/chain_id.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package utils | ||
package lib | ||
|
||
import ( | ||
"errors" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package lib | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"net" | ||
"time" | ||
) | ||
|
||
func IsOpened(host string, port string) bool { | ||
conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, port), time.Second) | ||
if err != nil { | ||
return false | ||
} | ||
|
||
if conn != nil { | ||
conn.Close() | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
|
||
func WaitPort(ctx context.Context, host, port string) error { | ||
var err error | ||
for done := false; !done && err == nil; { | ||
select { | ||
case <-ctx.Done(): | ||
err = fmt.Errorf("WaitPort(%s, %s) context closed", host, port) | ||
default: | ||
done = IsOpened(host, port) | ||
} | ||
} | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.