Skip to content

Commit

Permalink
test: don't connect to incompatible public testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Jun 8, 2021
1 parent bbce116 commit d56bb06
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
14 changes: 0 additions & 14 deletions integration_test/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ type txTypes struct {
}

var sentTxs txTypes
var useTestNet bool

func signBroadcastWaitKeepTrackOfTx(t *testing.T, tx transactions.Transaction, acc *account.Account, node *naet.Node) (height uint64, txHash string, mbHash string) {
receipt, err := aeternity.SignBroadcast(tx, acc, node, networkID)
Expand Down Expand Up @@ -107,14 +106,12 @@ func signBroadcastWaitKeepTrackOfTx(t *testing.T, tx transactions.Transaction, a
}

func TestMain(m *testing.M) {
flag.BoolVar(&useTestNet, "testnet", false, "Run tests that need an internet connection to testnet")
flag.Parse()
os.Exit(m.Run())
}

func TestAPI(t *testing.T) {
privateNet := setupNetwork(t, privatenetURL, false)
testNet := setupNetwork(t, testnetURL, false)
ttlnoncer := transactions.NewTTLNoncer(privateNet)

alice, bob := setupAccounts(t)
Expand Down Expand Up @@ -327,17 +324,6 @@ func TestAPI(t *testing.T) {
}
})

t.Run("GetKeyBlockByHash", func(t *testing.T) {
if !useTestNet {
t.Skip("-testnet not specified: skipping test")
}
_, err := testNet.GetKeyBlockByHash("kh_2ZPK9GGvXKJ8vfwapBLztd2F8DSr9QdphZRHSdJH8MR298Guao")
// t.Logf("%+v\n", gotKeyBlockByHash)
if err != nil {
t.Errorf("Client.GetKeyBlockByHash() error = %v", err)
return
}
})
t.Run("GetMicroBlockTransactionsByHash", func(t *testing.T) {
_, err := privateNet.GetMicroBlockTransactionsByHash(sentTxs.SpendTx.mbHash)
// t.Logf("%+v\n", gotMicroBlockTransactionsByHash)
Expand Down
1 change: 0 additions & 1 deletion integration_test/testsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ var sender = "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi"
var alicePrivateKey = "e6a91d633c77cf5771329d3354b3bcef1bc5e032c43d70b6d35af923ce1eb74dcea7ade470c9f99d9d4e400880a86f1d49bb444b62f11a9ebb64bbcfeb73fef3"
var bobPrivateKey = "7065616e38c1da983bc619188efe19bbddc8c149ddfcd3ed1c294294957a18477b47ed425587f4abd5064fe61d5a0121949a4125e8b700a2d14f0bbbafb8b2c6"
var privatenetURL = "http://localhost:3013"
var testnetURL = "http://sdk-testnet.aepps.com"
var networkID = "ae_docker"

func setupNetwork(t *testing.T, nodeURL string, debug bool) *naet.Node {
Expand Down

0 comments on commit d56bb06

Please sign in to comment.