Skip to content

Commit

Permalink
add json input to TestEgnAddrsWithServiceManagerFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasArrachea committed Sep 11, 2024
1 parent 569183e commit e798b32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/egnaddrs/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/Layr-Labs/eigensdk-go/testutils"
"github.com/ethereum/go-ethereum/common"
)

const (
Expand All @@ -21,10 +22,17 @@ func TestEgnAddrsWithServiceManagerFlag(t *testing.T) {
if err != nil {
t.Error(err)
}
contractAddrs := testutils.GetContractAddressesFromContractRegistry(anvilEndpoint)

// read input from JSON if available, otherwise use default values
var defaultInput = struct {
ServiceManagerAddress common.Address `json:"service_manager_address"`
}{
ServiceManagerAddress: testutils.GetContractAddressesFromContractRegistry(anvilEndpoint).ServiceManager,
}
testData := testutils.NewTestData(defaultInput)

args := []string{"egnaddrs"}
args = append(args, "--service-manager", contractAddrs.ServiceManager.Hex())
args = append(args, "--service-manager", testData.Input.ServiceManagerAddress.Hex())
args = append(args, "--rpc-url", anvilEndpoint)
// we just make sure it doesn't crash
run(args)
Expand Down

0 comments on commit e798b32

Please sign in to comment.