MCPcopy Create free account
hub / github.com/DEROFDN/Engram / getGasEstimate

Function getGasEstimate

functions.go:1435–1457  ·  view source on GitHub ↗

Get the transaction fees to be paid

(gp rpc.GasEstimate_Params)

Source from the content-addressed store, hash-verified

1433
1434// Get the transaction fees to be paid
1435func getGasEstimate(gp rpc.GasEstimate_Params) (gas uint64, err error) {
1436 var result rpc.GasEstimate_Result
1437
1438 rpc_client.WS, _, err = websocket.DefaultDialer.Dial("ws://"+session.Daemon+"/ws", nil)
1439 if err != nil {
1440 return
1441 }
1442
1443 input_output := rwc.New(rpc_client.WS)
1444 rpc_client.RPC = jrpc2.NewClient(channel.RawJSON(input_output, input_output), nil)
1445
1446 if err = rpc_client.RPC.CallResult(context.Background(), "DERO.GetGasEstimate", gp, &result); err != nil {
1447 return
1448 }
1449
1450 if result.Status != "OK" {
1451 return
1452 }
1453
1454 gas = result.GasStorage
1455
1456 return
1457}
1458
1459// Register a new DERO username
1460func registerUsername(s string) (storage uint64, err error) {

Callers 4

registerUsernameFunction · 0.85
installSCFunction · 0.85
transferUsernameFunction · 0.85
executeContractFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected