Transaction.fromBytes constructor
Transaction.fromBytes()
Implementation
Transaction.fromBytes(
Uint8List chainTag,
Uint8List blockRef,
Uint8List expiration,
List clauses,
Uint8List gasPriceCoef,
Uint8List gas,
Uint8List dependsOn,
Uint8List nonce,
List<Uint8List>? reserved) {
this.chainTag.fromBytes(chainTag);
this.blockRef.fromBytes(blockRef);
this.expiration.fromBytes(expiration);
List<Clause> _clauses = [];
for (List c in clauses) {
var to = Uint8List.fromList(c[0].cast<int>());
var value = Uint8List.fromList(c[1].cast<int>());
var data = Uint8List.fromList(c[2].cast<int>());
_clauses.add(Clause.fromBytes(to, value, data));
}
this.clauses = _clauses;
this.gasPriceCoef.fromBytes(gasPriceCoef);
this.gas.fromBytes(gas);
this.dependsOn.fromBytes(dependsOn);
this.nonce.fromBytes(nonce);
if (reserved != null) {
if (reserved.isNotEmpty) {
this.reserved = Reserved.unpack(reserved);
} else {
this.reserved = Reserved.getNullReserved();
}
} else {
this.reserved = Reserved.getNullReserved();
}
}