-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/consensus/api: Add
GetTransactionsWithResults
method
- Loading branch information
Showing
18 changed files
with
682 additions
and
391 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
go/consensus/api: Add `GetTransactionsWithResults` method | ||
|
||
`GetTransactionsWithResults` returns a list of transactions and their | ||
execution results, contained within a consensus block at a specific height. |
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
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,34 @@ | ||
package results | ||
|
||
import ( | ||
"github.com/oasisprotocol/oasis-core/go/common/errors" | ||
registry "github.com/oasisprotocol/oasis-core/go/registry/api" | ||
roothash "github.com/oasisprotocol/oasis-core/go/roothash/api" | ||
staking "github.com/oasisprotocol/oasis-core/go/staking/api" | ||
) | ||
|
||
// Event is a consensus service event that may be emitted during processing of | ||
// a transaction. | ||
type Event struct { | ||
Staking *staking.Event `json:"staking,omitempty"` | ||
Registry *registry.Event `json:"registry,omitempty"` | ||
RootHash *roothash.Event `json:"roothash,omitempty"` | ||
} | ||
|
||
// Error is a transaction execution error. | ||
type Error struct { | ||
Module string `json:"module,omitempty"` | ||
Code uint32 `json:"code,omitempty"` | ||
Message string `json:"message,omitempty"` | ||
} | ||
|
||
// Result is a transaction execution result. | ||
type Result struct { | ||
Error Error `json:"error"` | ||
Events []*Event `json:"events"` | ||
} | ||
|
||
// IsSuccess returns true if transaction execution was successful. | ||
func (r *Result) IsSuccess() bool { | ||
return r.Error.Code == errors.CodeNoError | ||
} |
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
Oops, something went wrong.