#include <transaction.hpp>
◆ Field
Enum containing available transaction fields.
Enumerator |
---|
Nonce | |
GasPrice | |
GasLimit | |
To | |
Value | |
Data | |
V | |
R | |
S | |
◆ FieldType
Enum containing available transaction fields types.
◆ Transaction()
Transaction::Transaction |
( |
| ) |
|
|
inline |
Constructs a new Transaction object. Creates SECP256K1 context.
◆ ~Transaction()
Transaction::~Transaction |
( |
| ) |
|
|
inline |
Destroys the Transaction object. Destroys SECP256K1 context.
◆ _keccak256()
KECCAK256 hashing function.
- Parameters
-
input | input buffer |
inputLength | input buffer length |
hash | output hash buffer |
- Returns
- output buffer length (always 32)
◆ _ecdsa()
ECDSA hashing function.
- Parameters
-
hash | 32 byte hash |
privateKey | 32 byte private key |
signature | output signature buffer |
recid | output recovery id |
- Returns
- output signature buffer length (always 64)
◆ setField() [1/2]
void Transaction::setField |
( |
Field |
field, |
|
|
const char * |
value |
|
) |
| |
|
inline |
Sets the transaction field value.
- Parameters
-
field | field name |
value | input c-string |
◆ setField() [2/2]
void Transaction::setField |
( |
Field |
field, |
|
|
Buffer |
value, |
|
|
std::size_t |
size |
|
) |
| |
|
inline |
Sets the transaction field value.
- Parameters
-
field | field name |
value | input buffer |
size | input buffer size |
◆ sign() [1/2]
std::size_t Transaction::sign |
( |
const char * |
privateKey, |
|
|
Utils::Buffer |
transaction |
|
) |
| |
|
inline |
Signs transaction.
- Parameters
-
privateKey | private key c-string to sign with |
transaction | output transaction buffer |
- Returns
- transaction buffer length
◆ sign() [2/2]
Signs transaction.
- Parameters
-
privateKey | private key buffer to sign with |
transaction | output transaction buffer |
- Returns
- transaction buffer length
◆ FieldsCount
constexpr std::size_t Transaction::FieldsCount = 9 |
|
inlinestaticconstexpr |
◆ fieldTypeMapping
|
inlinestaticconstexprprivate |
◆ secp256k1Context
secp256k1_context* Transaction::secp256k1Context |
|
private |
SECP256K1 context, allows preinitialization as it's very slow to create.
The purpose of context structures is to cache large precomputed data tables that are expensive to construct, and also to maintain the randomization data for blinding.
Do not create a new context object for each operation, as construction is far slower than all other API calls (~100 times slower than an ECDSA verification).
◆ nonce
◆ gasPrice
◆ gasLimit
◆ to
◆ value
◆ data
◆ rlpInput
Initial value:= {
{ .buffer =
nonce, .length = 0 },
{ .buffer =
to, .length = 0 },
{ .buffer =
value, .length = 0 },
{ .buffer =
data, .length = 0 },
{ .buffer =
v, .length = 0 },
{ .buffer =
r, .length = 0 },
{ .buffer =
s, .length = 0 },
}
Utils::Byte nonce[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:55
Utils::Byte r[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:62
Utils::Byte data[Config::Size::TransactionDataBuffer]
Definition: transaction.hpp:60
Utils::Byte s[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:63
Utils::Byte v[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:61
Utils::Byte gasLimit[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:57
Utils::Byte gasPrice[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:56
Utils::Byte to[Config::Size::TransactionAddressBuffer]
Definition: transaction.hpp:58
Utils::Byte value[Config::Size::TransactionQuantityBuffer]
Definition: transaction.hpp:59
RLP input data to encode.
The documentation for this class was generated from the following file: