pub fn validate_strategy_compatibility(
mode: NetworkMode,
strategy: FulfillmentStrategy,
) -> Result<(), ValidationError>
Expand description
Validates that the given fulfillment strategy is compatible with the specified network mode.
§Arguments
mode
- The network mode (Mainnet or Reserved)strategy
- The fulfillment strategy to validate
§Returns
Returns Ok(())
if the strategy is compatible with the mode, otherwise returns
a ValidationError::IncompatibleStrategy
.
§Examples
use sp1_sdk::network::{
validation::validate_strategy_compatibility, FulfillmentStrategy, NetworkMode,
};
// Valid combination
assert!(
validate_strategy_compatibility(NetworkMode::Mainnet, FulfillmentStrategy::Auction).is_ok()
);
// Invalid combination
assert!(
validate_strategy_compatibility(NetworkMode::Mainnet, FulfillmentStrategy::Hosted).is_err()
);