Skip to content

Commit 6dbb77d

Browse files
committed
types for abstract txs
1 parent dd7698a commit 6dbb77d

16 files changed

Lines changed: 365 additions & 708 deletions

proto/spacemesh/v1/types.proto

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,6 @@ message SmesherId {
3131
bytes id = 1;
3232
}
3333

34-
message GasOffered {
35-
uint64 gas_provided = 1;
36-
uint64 gas_price = 2;
37-
}
38-
39-
// Data specific to a simple coin transaction.
40-
message CoinTransferTransaction {
41-
AccountId receiver = 1;
42-
}
43-
44-
// Data specific to a smart contract transaction.
45-
message SmartContractTransaction {
46-
enum TransactionType {
47-
TRANSACTION_TYPE_UNSPECIFIED = 0;
48-
TRANSACTION_TYPE_APP = 1; // smart contract method
49-
TRANSACTION_TYPE_APP_SPAWN_APP = 2; // deploy app from template using svm terminology
50-
TRANSACTION_TYPE_DEPLOY_TEMPLATE = 3; // deploy app template code to mesh
51-
}
52-
TransactionType type = 1;
53-
bytes data = 2; // packed binary arguments, including ABI selector
54-
AccountId account_id = 3; // address of smart contract or template
55-
}
56-
57-
// A simple signature data
58-
message Signature {
59-
enum Scheme {
60-
SCHEME_UNSPECIFIED = 0;
61-
SCHEME_ED25519 = 1; // standard Ed25519 scheme
62-
SCHEME_ED25519_PLUS_PLUS = 2; // sm-modified ED25519 , a.k.a. ED25519++
63-
}
64-
Scheme scheme = 1; // the signature's scheme
65-
bytes signature = 2; // the signature itself
66-
bytes public_key = 3; // included in schemes which require signer to provide a public key
67-
}
68-
6934
// An Activation "transaction" (ATX)
7035
message Activation {
7136
ActivationId id = 1;
@@ -79,18 +44,29 @@ message Activation {
7944
// An immutable Spacemesh transaction.
8045
// do not include mutable data such as tx state or result.
8146
message Transaction {
82-
TransactionId id = 1;
83-
oneof datum {
84-
CoinTransferTransaction coin_transfer = 2;
85-
SmartContractTransaction smart_contract = 3;
86-
}
87-
AccountId sender = 4; // tx originator, should match signer inside Signature
88-
GasOffered gas_offered = 5; // gas price and max gas offered
89-
Amount amount = 6; // amount of coin transfered in this tx by sender
90-
uint64 counter = 7; // tx counter aka nonce
91-
Signature signature = 8; // sender signature on transaction
47+
bytes id = 1;
48+
bytes principal = 2;
49+
bytes template = 3;
50+
uint32 method = 4;
51+
Nonce nonce = 5;
52+
LayerLimits limits = 6;
53+
uint64 max_gas = 7;
54+
uint64 gas_price = 8;
55+
uint64 max_spend = 9;
56+
bytes raw = 10;
57+
}
58+
59+
message LayerLimits {
60+
uint32 min = 1;
61+
uint32 max = 2;
62+
}
63+
64+
message Nonce {
65+
uint64 counter = 1;
66+
uint32 bitfield = 2; // this is actually limited by uint8, but no type for that.
9267
}
9368

69+
9470
// Transaction that was added to the mesh.
9571
message MeshTransaction {
9672
Transaction transaction = 1;

release/go/spacemesh/v1/debug.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/debug_types.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/gateway.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/gateway_types.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/global_state.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/global_state_types.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/mesh.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/mesh_types.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/go/spacemesh/v1/node.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)