Skip to content

v0.26.0

Compare
Choose a tag to compare
@digorithm digorithm released this 14 Oct 15:51
· 421 commits to master since this release
5c81de8

What's Changed

  • feat!: add Option<Provider> as parameter in run_compiled_script by @Salka1988 in #610
  • Fix: change transfer_to_output to transfer_to_address by @digorithm in #614
  • Some minor cosmetic updates to the SDK Sway tests by @mohammadfawaz in #621
  • Test logging generics by @MujkicA in #616
  • feat: ParamType from TypeApplication/TypeDeclaration in order to generate fn selectors without code generation by @segfault-magnet in #619
  • refactor: change organisation of the integration tests by @hal3e in #607
  • fix: Ignore lock files and out/ directory by @digorithm in #623
  • ci: update forc version in CI by @iqdecay in #627
  • release: bump versions to v0.26.0 by @iqdecay in #626

New Contributors

Full Changelog: v0.25.1...v0.26.0

Breaking changes

Option<Provider> on run_compiled_script

run_compiled_script now takes an Option<Provider>, this is a straightforward change; All you have to do to migrate is add a None or pass a provider, if desired, to your run_compiled_script call.

New features

Generate ParamTypes from your JSON ABI TypeApplications

This has a niche use, mostly for internal tooling development. All you have to do is use ParamType::try_from_type_application(&type_appl, &type_lookup). Here's an example:

let abi: ProgramABI = serde_json::from_str(&abi_file_contents)?;

let type_lookup = abi
    .types
    .into_iter()
    .map(|a_type| (a_type.type_id, a_type))
    .collect::<HashMap<_, _>>();

let a_fun = abi
    .functions
    .into_iter()
    .find(|fun| fun.name == "array_of_structs")
    .unwrap();

let inputs = a_fun
    .inputs
    .into_iter()
    .map(|type_appl| ParamType::try_from_type_application(&type_appl, &type_lookup))
    .collect::<Result<Vec<_>, _>>()?;

let selector = resolve_fn_selector(&a_fun.name, &inputs);

assert_eq!(selector, [0, 0, 0, 0, 39, 152, 108, 146,]);