Skip to content

Commit

Permalink
Add BlockId to SubmitBlockResult
Browse files Browse the repository at this point in the history
  • Loading branch information
duggavo committed Aug 18, 2023
1 parent 3b9d235 commit 85421d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions rpc/daemon/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func (c *Client) GetBlock(
return resp, nil
}

// GetFeeEstimate gives an estimation on fees per byte.
func (c *Client) GetFeeEstimate(ctx context.Context, graceBlocks uint64) (*GetFeeEstimateResult, error) {
resp := &GetFeeEstimateResult{}
params := map[string]uint64{
Expand All @@ -343,6 +344,7 @@ func (c *Client) GetFeeEstimate(ctx context.Context, graceBlocks uint64) (*GetFe
return resp, nil
}

// SyncInfo gets synchronisation informations.
func (c *Client) SyncInfo(ctx context.Context) (*SyncInfoResult, error) {
resp := &SyncInfoResult{}

Expand All @@ -354,6 +356,7 @@ func (c *Client) SyncInfo(ctx context.Context) (*SyncInfoResult, error) {
return resp, nil
}

// CalcPow calculates PoW hash for a block candidate.
func (c *Client) CalcPow(ctx context.Context, params CalcPowParameters) (string, error) {
var resp string

Expand All @@ -365,6 +368,7 @@ func (c *Client) CalcPow(ctx context.Context, params CalcPowParameters) (string,
return resp, nil
}

// SubmitBlock submits a mined block to the network.
func (c *Client) SubmitBlock(ctx context.Context, minedBlockBlob string) (*SubmitBlockResult, error) {
resp := &SubmitBlockResult{}

Expand Down
3 changes: 2 additions & 1 deletion rpc/daemon/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,5 +856,6 @@ type CalcPowParameters struct {
}

type SubmitBlockResult struct {
Status string `json:"status"`
Status string `json:"status"`
BlockId string `json:"block_id"` // Submitted block's hash as a hexadecimal string
}

0 comments on commit 85421d9

Please sign in to comment.