Skip to content

Commit 634d6d7

Browse files
committed
hf test go: make client raw gql query private
1 parent c1916d3 commit 634d6d7

File tree

1 file changed

+8
-8
lines changed
  • src/app/hardfork_test/src/internal/client

1 file changed

+8
-8
lines changed

src/app/hardfork_test/src/internal/client/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func NewClient(timeoutSeconds int, maxRetries int) *Client {
2727
}
2828
}
2929

30-
// Query sends a GraphQL query to the specified port with retry logic
31-
func (c *Client) Query(port int, query string) (gjson.Result, error) {
30+
// query sends a GraphQL query to the specified port with retry logic
31+
func (c *Client) query(port int, query string) (gjson.Result, error) {
3232
url := fmt.Sprintf("http://localhost:%d/graphql", port)
3333

3434
// Format the query payload
@@ -99,7 +99,7 @@ func (c *Client) Query(port int, query string) (gjson.Result, error) {
9999

100100
// GetHeight gets the current block height
101101
func (c *Client) GetHeight(port int) (int, error) {
102-
result, err := c.Query(port, "bestChain(maxLength: 1) { protocolState { consensusState { blockHeight } } }")
102+
result, err := c.query(port, "bestChain(maxLength: 1) { protocolState { consensusState { blockHeight } } }")
103103
if err != nil {
104104
return 0, err
105105
}
@@ -110,7 +110,7 @@ func (c *Client) GetHeight(port int) (int, error) {
110110

111111
// GetHeightAndSlotOfEarliest gets the height and slot of the earliest block
112112
func (c *Client) GetHeightAndSlotOfEarliest(port int) (height, slot int, err error) {
113-
result, err := c.Query(port, "bestChain { protocolState { consensusState { blockHeight slotSinceGenesis } } }")
113+
result, err := c.query(port, "bestChain { protocolState { consensusState { blockHeight slotSinceGenesis } } }")
114114
if err != nil {
115115
return 0, 0, err
116116
}
@@ -123,7 +123,7 @@ func (c *Client) GetHeightAndSlotOfEarliest(port int) (height, slot int, err err
123123

124124
// GetForkConfig gets the fork configuration
125125
func (c *Client) GetForkConfig(port int) (gjson.Result, error) {
126-
result, err := c.Query(port, "fork_config")
126+
result, err := c.query(port, "fork_config")
127127
if err != nil {
128128
return gjson.Result{}, err
129129
}
@@ -133,7 +133,7 @@ func (c *Client) GetForkConfig(port int) (gjson.Result, error) {
133133

134134
// BlocksWithUserCommands gets the number of blocks with user commands
135135
func (c *Client) BlocksWithUserCommands(port int) (int, error) {
136-
result, err := c.Query(port, "bestChain { commandTransactionCount }")
136+
result, err := c.query(port, "bestChain { commandTransactionCount }")
137137
if err != nil {
138138
return 0, err
139139
}
@@ -150,7 +150,7 @@ func (c *Client) BlocksWithUserCommands(port int) (int, error) {
150150
}
151151

152152
// Blocks gets blocks data as in the original shell script
153-
const BlocksQuery = `
153+
const Blocksquery = `
154154
bestChain {
155155
commandTransactionCount
156156
protocolState {
@@ -197,7 +197,7 @@ type BlockData struct {
197197

198198
// GetBlocks retrieves block data from the node
199199
func (c *Client) GetBlocks(port int) ([]BlockData, error) {
200-
result, err := c.Query(port, BlocksQuery)
200+
result, err := c.query(port, Blocksquery)
201201
if err != nil {
202202
return nil, err
203203
}

0 commit comments

Comments
 (0)