/// The test ensures that registry mutations not affecting the conversion
/// rate are possible when a conversion rate is set in the registry.
The test ensures that registry mutations not affecting the conversion
rate are possible when a conversion rate is set in the registry.
The test ensures that registry mutations not affecting the conversion rate are possible when a conversion rate is set in the registry .
fn conversion_rate_invariant_unrelated_mutation() {
        // Create a valid registry:
        let mut registry = create_valid_registry();
        // Create a conversion rate to be added to the registry:
        let proposed_conversion_rate = IcpXdrConversionRateRecord {
            timestamp_seconds: 3141592,
            xdr_permyriad_per_icp: 123451234,
        };
        // Add the conversion rate to the registry:
        registry.maybe_apply_mutation_internal(vec![insert(
            &make_icp_xdr_conversion_rate_record_key().into_bytes(),
            encode_or_panic::<IcpXdrConversionRateRecord>(&proposed_conversion_rate),
        )]);
        // All global invariants should be satisfied when introducing an unrelated
        // mutation, e.g., resetting the routing table:
        registry.check_global_invariants(&[insert(
            make_routing_table_record_key(),
            encode_or_panic(&RoutingTable::default()),
        )]);
    }
fn conversion_rate_invariant_unrelated_mutation ( ) { // Create a valid registry: let mut registry = create_valid_registry ( ) ; // Create a conversion rate to be added to the registry: let proposed_conversion_rate = IcpXdrConversionRateRecord { timestamp_seconds : 3141592 , xdr_permyriad_per_icp : 123451234 , } ; // Add the conversion rate to the registry: registry . maybe_apply_mutation_internal ( vec ! [ insert ( make_icp_xdr_conversion_rate_record_key ( ) into_bytes ( ) encode_or_panic IcpXdrConversionRateRecord ( proposed_conversion_rate ) ) ] ) ; // All global invariants should be satisfied when introducing an unrelated // mutation, e.g., resetting the routing table: registry . check_global_invariants ( & [ insert ( make_routing_table_record_key ( ) , encode_or_panic ( & RoutingTable :: default ( ) ) , ) ] ) ; }
The test ensures that registry mutations not affecting the conversion
rate are possible when a conversion rate is set in the registry.
The test ensures that registry mutations not affecting the conversion rate are possible when a conversion rate is set in the registry .