diff --git a/account/account_test.go b/account/account_test.go index ea0db196..a931244c 100644 --- a/account/account_test.go +++ b/account/account_test.go @@ -17,10 +17,10 @@ import ( "github.com/NethermindEth/starknet.go/account" "github.com/NethermindEth/starknet.go/contracts" + "github.com/NethermindEth/starknet.go/devnet" "github.com/NethermindEth/starknet.go/hash" "github.com/NethermindEth/starknet.go/mocks" "github.com/NethermindEth/starknet.go/rpc" - "github.com/NethermindEth/starknet.go/test" "github.com/NethermindEth/starknet.go/utils" "github.com/golang/mock/gomock" "github.com/test-go/testify/require" @@ -709,8 +709,8 @@ func TestAddDeclareTxn(t *testing.T) { } } -func newDevnet(t *testing.T, url string) ([]test.TestAccount, error) { - devnet := test.NewDevNet(url) +func newDevnet(t *testing.T, url string) ([]devnet.TestAccount, error) { + devnet := devnet.NewDevNet(url) acnts, err := devnet.Accounts() return acnts, err } diff --git a/test/devnet.go b/devnet/devnet.go similarity index 99% rename from test/devnet.go rename to devnet/devnet.go index 50bf8eba..32295f9b 100644 --- a/test/devnet.go +++ b/devnet/devnet.go @@ -1,4 +1,4 @@ -package test +package devnet import ( "bytes" @@ -41,7 +41,6 @@ func (devnet *DevNet) api(uri string) string { func (devnet *DevNet) Accounts() ([]TestAccount, error) { req, err := http.NewRequest(http.MethodGet, devnet.api("/predeployed_accounts"), nil) if err != nil { - return nil, err } client := &http.Client{} diff --git a/test/devnet_test.go b/devnet/devnet_test.go similarity index 98% rename from test/devnet_test.go rename to devnet/devnet_test.go index 806c93e5..0082c0c9 100644 --- a/test/devnet_test.go +++ b/devnet/devnet_test.go @@ -1,4 +1,4 @@ -package test +package devnet import ( "math/big" diff --git a/devnet/main_test.go b/devnet/main_test.go new file mode 100644 index 00000000..5022fa38 --- /dev/null +++ b/devnet/main_test.go @@ -0,0 +1,28 @@ +package devnet + +import ( + "flag" + "os" + "testing" +) + +const ( + DevNetETHAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" +) + +// testConfiguration is a type that is used to configure tests +type testConfiguration struct { + base string +} + +var ( + // set the environment for the test, default: devnet + testEnv = "devnet" +) + +// TestMain is used to trigger the tests and, in that case, check for the environment to use. +func TestMain(m *testing.M) { + flag.StringVar(&testEnv, "env", "devnet", "set the test environment") + flag.Parse() + os.Exit(m.Run()) +} diff --git a/test/main_test.go b/test/main_test.go deleted file mode 100644 index d3331cfe..00000000 --- a/test/main_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package test - -import ( - "flag" - "os" - "testing" -) - -const ( - DevNetETHAddress = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" - TestNetETHAddress = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" - DevNetAccount032Address = "0x06bb9425718d801fd06f144abb82eced725f0e81db61d2f9f4c9a26ece46a829" - TestNetAccount032Address = "0x6ca4fdd437dffde5253ba7021ef7265c88b07789aa642eafda37791626edf00" - DevNetAccount040Address = "0x080dff79c6216ad300b872b73ff41e271c63f213f8a9dc2017b164befa53b9" - TestNetAccount040Address = "0x6cbfa37f409610fee26eeb427ed854b3a4b24580d9b9ef6c3e38db7b3f7322c" -) - -// testConfiguration is a type that is used to configure tests -type testConfiguration struct { - base string -} - -var ( - // set the environment for the test, default: devnet - testEnv = "devnet" -) - -// TestMain is used to trigger the tests and, in that case, check for the environment to use. -func TestMain(m *testing.M) { - flag.StringVar(&testEnv, "env", "devnet", "set the test environment") - flag.Parse() - os.Exit(m.Run()) -}