Skip to content

Commit 63f4615

Browse files
committed
transactions results
1 parent 6dbb77d commit 63f4615

6 files changed

Lines changed: 452 additions & 48 deletions

File tree

proto/spacemesh/v1/tx.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ service TransactionService {
2626
// Returns tx state for one or more txs every time the tx state changes for
2727
// one of these txs
2828
rpc TransactionsStateStream(TransactionsStateStreamRequest) returns (stream TransactionsStateStreamResponse);
29+
30+
// StreamResults streams historical data and watch live events with transaction results.
31+
rpc StreamResults(TransactionResultsRequest) returns (stream TransactionResult);
2932
}

proto/spacemesh/v1/tx_types.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,34 @@ message TransactionState {
5353
}
5454
TransactionState state = 2;
5555
}
56+
57+
// TransactionResultsRequest request object for results stream.
58+
message TransactionResultsRequest {
59+
// id is filter by transaction id.
60+
bytes id = 1;
61+
// address is a filter by account address, it could be principal or any affected address.
62+
bytes address = 2;
63+
// start streaming from this layer. if 0 - stream will start from genesis.
64+
uint32 start = 3;
65+
// end streaming at this layer. if 0 - stream till the latest available layer.
66+
uint32 end = 4;
67+
// watch live data.
68+
bool watch = 5;
69+
}
70+
71+
message TransactionResult {
72+
enum Status {
73+
SUCCESS = 0;
74+
FAILURE = 1;
75+
INVALID = 2;
76+
}
77+
78+
Transaction tx = 1;
79+
Status status = 2;
80+
string message = 3;
81+
uint64 gas_consumed = 4;
82+
uint64 fee = 5;
83+
bytes block = 6;
84+
uint32 layer = 7;
85+
repeated bytes touched_addresses = 8;
86+
}

proto/spacemesh/v1/types.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ message Transaction {
4747
bytes id = 1;
4848
bytes principal = 2;
4949
bytes template = 3;
50-
uint32 method = 4;
50+
uint32 method = 4; // this is actually limited by uint8, but no type for that.
5151
Nonce nonce = 5;
5252
LayerLimits limits = 6;
5353
uint64 max_gas = 7;
@@ -111,4 +111,3 @@ message AppEvent { // an event emitted from an app instance
111111
TransactionId transaction_id = 1; // the transaction that called the code
112112
string message = 2; // the event's string emitted from code
113113
}
114-

release/go/spacemesh/v1/tx.pb.go

Lines changed: 89 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)