This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add execute aireq gas & check report size
- Loading branch information
1 parent
f2bb5df
commit 2c837d8
Showing
4 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package subscribe | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"net/http" | ||
) | ||
|
||
// MinGasPrices is the struct for querying the minimum gas prices of a node | ||
type MinGasPrices struct { | ||
Price string `json:"minFees"` | ||
} | ||
|
||
func getMinGasPrices() (string, error) { | ||
resp, err := http.Get("http://localhost:1317/provider/minfees?OracleScriptName=min_gas_prices&ValNum=0") | ||
if err != nil { | ||
return "", err | ||
} | ||
defer resp.Body.Close() | ||
body, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return "", err | ||
} | ||
var minGasPrices MinGasPrices | ||
// collect response from the request | ||
json.Unmarshal(body, &minGasPrices) | ||
fmt.Println("min gas prices: ", minGasPrices.Price) | ||
return minGasPrices.Price, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters