github.com/hashgraph/hedera-sdk-go/v2@v2.48.0/network_version_info_query_e2e_test.go (about) 1 //go:build all || e2e 2 // +build all e2e 3 4 package hedera 5 6 /*- 7 * 8 * Hedera Go SDK 9 * 10 * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC 11 * 12 * Licensed under the Apache License, Version 2.0 (the "License"); 13 * you may not use this file except in compliance with the License. 14 * You may obtain a copy of the License at 15 * 16 * http://www.apache.org/licenses/LICENSE-2.0 17 * 18 * Unless required by applicable law or agreed to in writing, software 19 * distributed under the License is distributed on an "AS IS" BASIS, 20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 * See the License for the specific language governing permissions and 22 * limitations under the License. 23 * 24 */ 25 26 import ( 27 "testing" 28 29 "github.com/stretchr/testify/require" 30 ) 31 32 func TestIntegrationNetworkVersionInfoQueryCanExecute(t *testing.T) { 33 t.Parallel() 34 env := NewIntegrationTestEnv(t) 35 36 _, err := NewNetworkVersionQuery(). 37 SetMaxQueryPayment(NewHbar(1)). 38 SetNodeAccountIDs(env.NodeAccountIDs). 39 Execute(env.Client) 40 require.NoError(t, err) 41 err = CloseIntegrationTestEnv(env, nil) 42 require.NoError(t, err) 43 } 44 45 func TestIntegrationNetworkVersionInfoQueryGetCost(t *testing.T) { 46 t.Parallel() 47 env := NewIntegrationTestEnv(t) 48 49 query := NewNetworkVersionQuery().SetNodeAccountIDs(env.NodeAccountIDs) 50 51 cost, err := query.GetCost(env.Client) 52 require.NoError(t, err) 53 54 _, err = query.SetQueryPayment(cost).Execute(env.Client) 55 require.NoError(t, err) 56 57 err = CloseIntegrationTestEnv(env, nil) 58 require.NoError(t, err) 59 }