@@ -1135,6 +1135,18 @@ impl TransactionSpendingCondition {
1135
1135
}
1136
1136
}
1137
1137
}
1138
+
1139
+ /// Checks if this TransactionSpendingCondition is supported in the passed epoch
1140
+ /// OrderIndependent multisig is not supported before epoch 3.0
1141
+ pub fn is_supported_in_epoch ( & self , epoch_id : StacksEpochId ) -> bool {
1142
+ match self {
1143
+ TransactionSpendingCondition :: Singlesig ( ..)
1144
+ | TransactionSpendingCondition :: Multisig ( ..) => true ,
1145
+ TransactionSpendingCondition :: OrderIndependentMultisig ( ..) => {
1146
+ epoch_id >= StacksEpochId :: Epoch30
1147
+ }
1148
+ }
1149
+ }
1138
1150
}
1139
1151
1140
1152
impl StacksMessageCodec for TransactionAuth {
@@ -1391,48 +1403,11 @@ impl TransactionAuth {
1391
1403
/// Checks if this TransactionAuth is supported in the passed epoch
1392
1404
/// OrderIndependent multisig is not supported before epoch 3.0
1393
1405
pub fn is_supported_in_epoch ( & self , epoch_id : StacksEpochId ) -> bool {
1394
- match & self {
1395
- TransactionAuth :: Standard ( TransactionSpendingCondition :: OrderIndependentMultisig (
1396
- ..,
1397
- ) )
1398
- | TransactionAuth :: Sponsored (
1399
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1400
- TransactionSpendingCondition :: Multisig ( ..) ,
1401
- )
1402
- | TransactionAuth :: Sponsored (
1403
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1404
- TransactionSpendingCondition :: Singlesig ( ..) ,
1405
- )
1406
- | TransactionAuth :: Sponsored (
1407
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1408
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1409
- )
1410
- | TransactionAuth :: Sponsored (
1411
- TransactionSpendingCondition :: Multisig ( ..) ,
1412
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1413
- )
1414
- | TransactionAuth :: Sponsored (
1415
- TransactionSpendingCondition :: Singlesig ( ..) ,
1416
- TransactionSpendingCondition :: OrderIndependentMultisig ( ..) ,
1417
- ) => epoch_id >= StacksEpochId :: Epoch30 ,
1418
- TransactionAuth :: Standard ( TransactionSpendingCondition :: Multisig ( ..) )
1419
- | TransactionAuth :: Standard ( TransactionSpendingCondition :: Singlesig ( ..) )
1420
- | TransactionAuth :: Sponsored (
1421
- TransactionSpendingCondition :: Multisig ( ..) ,
1422
- TransactionSpendingCondition :: Multisig ( ..) ,
1423
- )
1424
- | TransactionAuth :: Sponsored (
1425
- TransactionSpendingCondition :: Multisig ( ..) ,
1426
- TransactionSpendingCondition :: Singlesig ( ..) ,
1427
- )
1428
- | TransactionAuth :: Sponsored (
1429
- TransactionSpendingCondition :: Singlesig ( ..) ,
1430
- TransactionSpendingCondition :: Singlesig ( ..) ,
1431
- )
1432
- | TransactionAuth :: Sponsored (
1433
- TransactionSpendingCondition :: Singlesig ( ..) ,
1434
- TransactionSpendingCondition :: Multisig ( ..) ,
1435
- ) => true ,
1406
+ match self {
1407
+ TransactionAuth :: Standard ( origin) => origin. is_supported_in_epoch ( epoch_id) ,
1408
+ TransactionAuth :: Sponsored ( origin, sponsor) => {
1409
+ origin. is_supported_in_epoch ( epoch_id) && sponsor. is_supported_in_epoch ( epoch_id)
1410
+ }
1436
1411
}
1437
1412
}
1438
1413
}
0 commit comments