mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-20 13:56:45 +00:00

* start * pass tests, (cannot get before put!) and clean up. * add rpc call. * create and pass tests, fix bugs. fully implement rpc * As always fmt * remover old test * clean up proto comment * put the logger back in place. * revert back to 10 sec limit. * migration, change utxoChanged removal to whole utxoEntryPair, add methods to update circulating supply, intialize circulating supply from reset. * Update utxoindex.go * ad * rename to max, change comment * one more total to max Co-authored-by: Ori Newman <orinewman1@gmail.com>
21 lines
750 B
Go
21 lines
750 B
Go
package rpcclient
|
|
|
|
import "github.com/kaspanet/kaspad/app/appmessage"
|
|
|
|
// GetCoinSupply sends an RPC request respective to the function's name and returns the RPC server's response
|
|
func (c *RPCClient) GetCoinSupply() (*appmessage.GetCoinSupplyResponseMessage, error) {
|
|
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewGetCoinSupplyRequestMessage())
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
response, err := c.route(appmessage.CmdGetCoinSupplyResponseMessage).DequeueWithTimeout(c.timeout)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
geCoinSupplyResponse := response.(*appmessage.GetCoinSupplyResponseMessage)
|
|
if geCoinSupplyResponse.Error != nil {
|
|
return nil, c.convertRPCError(geCoinSupplyResponse.Error)
|
|
}
|
|
return geCoinSupplyResponse, nil
|
|
}
|