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
-
commit(
Uint8List transactionId, BlockModel block, Uint8List merkelProof) → void - Commits a TransactionModel by persisting 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
-
validateAuthor(
TransactionModel transaction, RsaPublicKey pubKey) → bool - Validates the author of the TransactionModel by calling Rsa.verify with its TransactionModel.signature.
-
validateInclusion(
TransactionModel transaction, Uint8List root) → bool - Validates the TransactionModel inclusion in TransactionModel.block by validating its TransactionModel.merkelProof with MerkelTree.validate.
-
validateIntegrity(
TransactionModel transaction) → bool - Validates the TransactionModel integrity by rebuilding its hash TransactionModel.id.