Skip to content

Commit

Permalink
update/add_convenient_converter (#120)
Browse files Browse the repository at this point in the history
Added convenient converter function
  • Loading branch information
ZhmakAS authored Oct 11, 2024
1 parent d66e6eb commit 2b8869d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rpc/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@ type InfoGetDeployResult struct {
rawJSON json.RawMessage
}

func (r *InfoGetDeployResult) InfoGetTransactionResult() InfoGetTransactionResult {
return InfoGetTransactionResult{
APIVersion: r.ApiVersion,
Transaction: types.NewTransactionFromDeploy(r.Deploy),
ExecutionInfo: &types.ExecutionInfo{
BlockHash: r.ExecutionResults.BlockHash,
BlockHeight: r.ExecutionResults.BlockHeight,
ExecutionResult: r.ExecutionResults.ExecutionResult,
},
rawJSON: r.GetRawJSON(),
}
}

type infoGetDeployResultV1Compatible struct {
ApiVersion string `json:"api_version"`
Deploy types.Deploy `json:"deploy"`
Expand Down

0 comments on commit 2b8869d

Please sign in to comment.