Skip to content

Commit 8cdfde5

Browse files
authored
Merge pull request #1039 from mintlayer/alfie/blockprod-functional-tests
Add Blockprod functional tests
2 parents d2c572e + 709f53d commit 8cdfde5

File tree

11 files changed

+978
-19
lines changed

11 files changed

+978
-19
lines changed

chainstate/src/detail/ban_score.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl BanScore for ConnectTransactionError {
137137
ConnectTransactionError::TxVerifierStorage => 0,
138138
ConnectTransactionError::PoolOwnerRewardCalculationFailed(_, _) => 100,
139139
ConnectTransactionError::PoolOwnerRewardCannotExceedTotalReward(_, _, _, _) => 100,
140+
ConnectTransactionError::UnexpectedPoolId(_, _) => 100,
140141
ConnectTransactionError::DelegationsRewardSumFailed(_, _) => 100,
141142
ConnectTransactionError::DelegationRewardOverflow(_, _, _, _) => 100,
142143
ConnectTransactionError::DistributedDelegationsRewardExceedTotal(_, _, _, _) => 100,

chainstate/tx-verifier/src/transaction_verifier/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ pub enum ConnectTransactionError {
121121
"Reward in block {0} for owner of the pool {1} which is {2:?} cannot be bigger than total reward {3:?}"
122122
)]
123123
PoolOwnerRewardCannotExceedTotalReward(Id<Block>, PoolId, Amount, Amount),
124+
#[error("Unexpected pool id in kernel {0} doesn't match pool id {1}")]
125+
UnexpectedPoolId(PoolId, PoolId),
124126
#[error("Failed to sum block {0} reward for pool {1} delegations")]
125127
DelegationsRewardSumFailed(Id<Block>, PoolId),
126128
#[error("Reward for delegation {0} overflowed: {1:?}*{2:?}/{3:?}")]
@@ -280,7 +282,7 @@ pub enum SpendStakeError {
280282
InvalidBlockRewardOutputType,
281283
#[error("Stake pool data in kernel doesn't match data in block reward output")]
282284
StakePoolDataMismatch,
283-
#[error("Pool id in kernel {0} doesn't match id in block reward output {1}")]
285+
#[error("Pool id in kernel {0} doesn't match the expected pool id {1}")]
284286
StakePoolIdMismatch(PoolId, PoolId),
285287
#[error("Consensus PoS error: {0}")]
286288
ConsensusPoSError(#[from] consensus::ConsensusPoSError),

chainstate/tx-verifier/src/transaction_verifier/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ where
476476
))
477477
}
478478
} else {
479-
Err(ConnectTransactionError::SpendStakeError(
480-
SpendStakeError::StakePoolIdMismatch(expected_pool_id, *pool_id),
479+
Err(ConnectTransactionError::UnexpectedPoolId(
480+
*pool_id,
481+
expected_pool_id,
481482
))
482483
};
483484
Some(res)

mempool/src/error/ban_score.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ impl MempoolBanScore for ConnectTransactionError {
136136
ConnectTransactionError::SpendStakeError(_) => 100,
137137
ConnectTransactionError::PoolOwnerRewardCalculationFailed(_, _) => 100,
138138
ConnectTransactionError::PoolOwnerRewardCannotExceedTotalReward(_, _, _, _) => 100,
139+
ConnectTransactionError::UnexpectedPoolId(_, _) => 100,
139140
ConnectTransactionError::NotEnoughPledgeToCreateStakePool(_, _, _) => 100,
140141
ConnectTransactionError::AttemptToCreateStakePoolFromAccounts => 100,
141142
ConnectTransactionError::AttemptToCreateDelegationFromAccounts => 100,

mempool/src/pool/orphans/detect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ impl OrphanType {
7676
| CTE::PoolDataNotFound(_)
7777
| CTE::PoolOwnerRewardCalculationFailed(_, _)
7878
| CTE::PoolOwnerRewardCannotExceedTotalReward(..)
79+
| CTE::UnexpectedPoolId(_, _)
7980
| CTE::DelegationsRewardSumFailed(..)
8081
| CTE::DelegationRewardOverflow(..)
8182
| CTE::DistributedDelegationsRewardExceedTotal(..)

0 commit comments

Comments
 (0)