Skip to content

v0.42.0

Compare
Choose a tag to compare
@digorithm digorithm released this 25 May 22:56
· 211 commits to master since this release
5fdea70

What's Changed

Full Changelog: v0.41.0...v0.42.0

Breaking changes

Types import path changes

  • Use fuels::types::input::Input instead of fuels::tx::input
  • Use fuels::types::coin::Coin instead of fuels::client::schema::coin::Coin and fuels::tx::Output::Coin
  • Use fuels::types::AssetId instead of fuels::client::schema::AssetId and fuels::tx::AssetId
  • Use fuels::tx::UtxoId instead of fuels::client::schema::UtxoId
  • Use fuels::types::coin::CoinStatus instead of fuels::client::schema::coin::CoinStatus
  • Use fuels::types::resource::Resource instead of fuels::client::schema::resource::Resource
  • Use fuels_types::types::Bytes32 instead of fuel_tx::Bytes32

Configurables for predicates

    abigen!(Predicate(
        name = "MyPredicate",
        abi = "packages/fuels/tests/predicates/predicate_configurables/out/debug/predicate_configurables-abi.json"
    ));

    let new_struct = StructWithGeneric {
        field_1: 32u8,
        field_2: 64,
    };
    let new_enum = EnumWithGeneric::VariantTwo;

    let configurables = MyPredicateConfigurables::new()
        .set_STRUCT(new_struct.clone())
        .set_ENUM(new_enum.clone());

    let predicate_data = MyPredicateEncoder::encode_data(8u8, true, new_struct, new_enum);

    let mut predicate: Predicate = Predicate::load_from(
        "tests/predicates/predicate_configurables/out/debug/predicate_configurables.bin",
    )?
    .with_data(predicate_data)
    .with_configurables(configurable);

fuel-core @ 0.18 changes

Note that some of these changes are subject to subsequent changes in future UX improvements.

  • Signing the transaction and predicate id generation requires ChainId(ConsensusParameters).
  • Now, tokens should be transferred to the contract first, and after you can transfer them via SMO or another transfer. So in some tests, we first need to transfer money to the contract.
  • The produce_blocks function is updated and doesn't require TimeParameters.
  • Removed redundant usage of MessageId. Now the identifier of the message is a Nonce.
  • Removed Output::Message. Now you don't need to specify it in the outputs. Because of that SMO opcode doesn't require a message output index.
  • The proof API is updated with a new design: FuelLabs/fuel-core#1046. To prove the block at height X, you need at least a committed X + 1 block.
  • Predicate::set_provider now returns a Result because it can fail if the "new" provider has different consensus parameters than the consensus parameters used previously
  • Predicate can be loaded with a provider using load_from_with_provider and from_code_and_provider. The from_code and load_from remain and use the default ConsensusParameters value.
  • Provider::new now takes a ConsensusParameters argument, so we can avoid changing the API of downstream clients.
  • setup_test_client now returns ConsensusParameters of the client. This was either this or setup_test_provider would have to change, and the former is much less used than the latter.