TransactionService class Null safety

The service to manage transactions in the chain.

Constructors

TransactionService(Database db)

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(TransactionModel txn) → void
Adds a TransactionModel to local database.
commit(Uint8List transactionId, BlockModel block, Uint8List merkelProof) → void
Commits a TransactionModel by persisting its its TransactionModel.block and TransactionModel.merkelProof values.
create(Uint8List contents, KeyModel key, {String assetRef = 'AA=='}) TransactionModel
Creates a TransactionModel with contents.
getByBlock(Uint8List id) → List<TransactionModel>
Gets all the transactions from a BlockModel by its BlockModel.id.
getPending() → List<TransactionModel>
Gets all the transactions that were not committed by commit.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

deserializeTransactions(Uint8List serializedBlock) → List<TransactionModel>
Creates a List of TransactionModel] from a Uint8List of the serialized block.
validateAuthor(TransactionModel transaction, RsaPublicKey pubKey) → bool
Validates the author of the TransactionModel by calling verify with its TransactionModel.signature.
validateInclusion(TransactionModel transaction, Uint8List root) → bool
Validates the TransactionModel inclusion in TransactionModel.block by checking validating its TransactionModel.merkelProof with MerkelTree.validate.
validateIntegrity(TransactionModel transaction) → bool
Validates the TransactionModel integrity by rebuilds it hash TransactionModel.id.