Skip to content

Commit

Permalink
transactions results
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Jul 1, 2022
1 parent 6dbb77d commit 63f4615
Show file tree
Hide file tree
Showing 6 changed files with 452 additions and 48 deletions.
3 changes: 3 additions & 0 deletions proto/spacemesh/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ service TransactionService {
// Returns tx state for one or more txs every time the tx state changes for
// one of these txs
rpc TransactionsStateStream(TransactionsStateStreamRequest) returns (stream TransactionsStateStreamResponse);

// StreamResults streams historical data and watch live events with transaction results.
rpc StreamResults(TransactionResultsRequest) returns (stream TransactionResult);
}
31 changes: 31 additions & 0 deletions proto/spacemesh/v1/tx_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,34 @@ message TransactionState {
}
TransactionState state = 2;
}

// TransactionResultsRequest request object for results stream.
message TransactionResultsRequest {
// id is filter by transaction id.
bytes id = 1;
// address is a filter by account address, it could be principal or any affected address.
bytes address = 2;
// start streaming from this layer. if 0 - stream will start from genesis.
uint32 start = 3;
// end streaming at this layer. if 0 - stream till the latest available layer.
uint32 end = 4;
// watch live data.
bool watch = 5;
}

message TransactionResult {
enum Status {
SUCCESS = 0;
FAILURE = 1;
INVALID = 2;
}

Transaction tx = 1;
Status status = 2;
string message = 3;
uint64 gas_consumed = 4;
uint64 fee = 5;
bytes block = 6;
uint32 layer = 7;
repeated bytes touched_addresses = 8;
}
3 changes: 1 addition & 2 deletions proto/spacemesh/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ message Transaction {
bytes id = 1;
bytes principal = 2;
bytes template = 3;
uint32 method = 4;
uint32 method = 4; // this is actually limited by uint8, but no type for that.
Nonce nonce = 5;
LayerLimits limits = 6;
uint64 max_gas = 7;
Expand Down Expand Up @@ -111,4 +111,3 @@ message AppEvent { // an event emitted from an app instance
TransactionId transaction_id = 1; // the transaction that called the code
string message = 2; // the event's string emitted from code
}

103 changes: 89 additions & 14 deletions release/go/spacemesh/v1/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 63f4615

Please sign in to comment.