-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathnode_update_transaction_e2e_test.go
More file actions
71 lines (56 loc) · 1.97 KB
/
Copy pathnode_update_transaction_e2e_test.go
File metadata and controls
71 lines (56 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//go:build all || e2e
// +build all e2e
package hiero
import (
"testing"
"github.com/stretchr/testify/require"
)
// SPDX-License-Identifier: Apache-2.0
func TestIntegrationNodeUpdateTransactionCanExecute(t *testing.T) {
t.Parallel()
// Set the network
network := make(map[string]AccountID)
network["localhost:50211"] = AccountID{Account: 3}
client, err := ClientForNetworkV2(network)
require.NoError(t, err)
mirror := []string{"localhost:5600"}
client.SetMirrorNetwork(mirror)
// Set the operator to be account 0.0.2
originalOperatorKey, err := PrivateKeyFromStringEd25519("302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137")
require.NoError(t, err)
client.SetOperator(AccountID{Account: 2}, originalOperatorKey)
domainName := "testWebUpdated.com"
resp, err := NewNodeUpdateTransaction().
SetNodeID(0).
SetDescription("testUpdated").
SetDeclineReward(true).
SetGrpcWebProxyEndpoint(Endpoint{
domainName: &domainName,
port: 123456,
}).
Execute(client)
require.NoError(t, err)
_, err = resp.SetValidateStatus(true).GetReceipt(client)
require.NoError(t, err)
}
func TestIntegrationNodeUpdateTransactionDeleteGrpcWebProxyEndpoint(t *testing.T) {
t.Parallel()
// Set the network
network := make(map[string]AccountID)
network["localhost:50211"] = AccountID{Account: 3}
client, err := ClientForNetworkV2(network)
require.NoError(t, err)
mirror := []string{"localhost:5600"}
client.SetMirrorNetwork(mirror)
// Set the operator to be account 0.0.2
originalOperatorKey, err := PrivateKeyFromStringEd25519("302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137")
require.NoError(t, err)
client.SetOperator(AccountID{Account: 2}, originalOperatorKey)
resp, err := NewNodeUpdateTransaction().
SetNodeID(0).
DeleteGrpcWebProxyEndpoint().
Execute(client)
require.NoError(t, err)
_, err = resp.SetValidateStatus(true).GetReceipt(client)
require.NoError(t, err)
}