setValidityExpiration method
void
setValidityExpiration({})
Restricts validity to a chain, time window and optionally a validator set. Timestamp bounds are milliseconds since the Unix epoch.
Implementation
void setValidityExpiration({
BigInt? minEpoch,
BigInt? maxEpoch,
BigInt? minTimestamp,
BigInt? maxTimestamp,
required String chain,
required int nonce,
BigInt? proposerEpoch,
List<int>? allowedProposers,
}) {
if ((proposerEpoch == null) != (allowedProposers == null)) {
throw ArgumentError(
'proposerEpoch and allowedProposers must be provided together',
);
}
if (allowedProposers != null) {
SuiBcs.validateAllowedProposers(allowedProposers);
}
_blockData.expiration = TransactionExpiration(
validity: {
'minEpoch': minEpoch?.toString(),
'maxEpoch': maxEpoch?.toString(),
'minTimestamp': minTimestamp?.toString(),
'maxTimestamp': maxTimestamp?.toString(),
'chain': chain,
'nonce': nonce,
'allowedProposers': allowedProposers == null
? null
: {
'epoch': proposerEpoch.toString(),
'proposers': List<int>.of(allowedProposers),
},
},
);
}