diff --git a/bouncer/package.json b/bouncer/package.json index 12bb5f412b..0baa157a4c 100644 --- a/bouncer/package.json +++ b/bouncer/package.json @@ -6,7 +6,7 @@ "prettier:write": "prettier --write ." }, "dependencies": { - "@chainflip/cli": "1.8.0-rc.1", + "@chainflip/cli": "1.8.0-rc.2", "@chainflip/utils": "^0.4.0", "@coral-xyz/anchor": "^0.30.1", "@iarna/toml": "^2.2.5", diff --git a/bouncer/pnpm-lock.yaml b/bouncer/pnpm-lock.yaml index 482e56ad92..17dee78a33 100644 --- a/bouncer/pnpm-lock.yaml +++ b/bouncer/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@chainflip/cli': - specifier: 1.8.0-rc.1 - version: 1.8.0-rc.1(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10) + specifier: 1.8.0-rc.2 + version: 1.8.0-rc.2(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10) '@chainflip/utils': specifier: ^0.4.0 version: 0.4.0 @@ -145,8 +145,8 @@ packages: '@chainflip/bitcoin@1.1.1': resolution: {integrity: sha512-Jr6X/0QTSFYpTp23ZPhyioL6wL9x3Xpj6OGjadQKZyhobRN4BZkhLogv20HDYTJcRzVphzrTJArbEaNie04XVA==} - '@chainflip/cli@1.8.0-rc.1': - resolution: {integrity: sha512-e8TWjBCgwRmfcGbq59ELs1xQglXc4/lGGYiC0DwYIsN58NNFbFL04UDsS2rOivrnxlx9kwOihGU5AZABtup12g==} + '@chainflip/cli@1.8.0-rc.2': + resolution: {integrity: sha512-CLAqtbQWhD4IzA1edwBbR0CgQej4DycvTPMcBPhNnSQoK85svB8u1ZYtn6XHz6yyoDJjbiDRrYN6AMIaGCjgDw==} hasBin: true peerDependencies: axios: ^1.x @@ -3169,7 +3169,7 @@ snapshots: transitivePeerDependencies: - typescript - '@chainflip/cli@1.8.0-rc.1(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10)': + '@chainflip/cli@1.8.0-rc.2(axios@1.7.2)(bufferutil@4.0.8)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typescript@5.5.3)(utf-8-validate@5.0.10)': dependencies: '@chainflip/bitcoin': 1.1.1(typescript@5.5.3) '@chainflip/extrinsics': 1.6.1 diff --git a/engine/src/witness/common/cf_parameters.rs b/engine/src/witness/common/cf_parameters.rs index e84d88812f..d27c5834a7 100644 --- a/engine/src/witness/common/cf_parameters.rs +++ b/engine/src/witness/common/cf_parameters.rs @@ -3,15 +3,19 @@ use cf_primitives::{BasisPoints, Beneficiaries, DcaParameters}; use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Debug)] +pub enum VersionedCfParameters { + V0(CfParameters), +} + #[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Debug)] pub struct CfParameters { - /// CCMs may require additional data (for example CCMs to Solana require adding a list of - /// addresses). + /// CCMs may require additional data (e.g. CCMs to Solana requires a list of addresses). pub ccm_additional_data: CcmData, pub vault_swap_parameters: VaultSwapParameters, } -pub type CcmCfParameters = CfParameters; +pub type VersionedCcmCfParameters = VersionedCfParameters; // TODO: Define this / implement it on the SC - PRO-1743. pub type ShortId = u8; diff --git a/engine/src/witness/evm/vault.rs b/engine/src/witness/evm/vault.rs index 34a8f2a3b9..7f6f842abf 100644 --- a/engine/src/witness/evm/vault.rs +++ b/engine/src/witness/evm/vault.rs @@ -66,8 +66,10 @@ where sender: _, cf_parameters, }) => { - let CfParameters { ccm_additional_data: (), vault_swap_parameters } = - CfParameters::decode(&mut &cf_parameters[..])?; + let VersionedCfParameters::V0(CfParameters { + ccm_additional_data: (), + vault_swap_parameters, + }) = VersionedCfParameters::decode(&mut &cf_parameters[..])?; Some(CallBuilder::vault_swap_request( native_asset, @@ -91,8 +93,10 @@ where sender: _, cf_parameters, }) => { - let CfParameters { ccm_additional_data: (), vault_swap_parameters } = - CfParameters::decode(&mut &cf_parameters[..])?; + let VersionedCfParameters::V0(CfParameters { + ccm_additional_data: (), + vault_swap_parameters, + }) = VersionedCfParameters::decode(&mut &cf_parameters[..])?; Some(CallBuilder::vault_swap_request( *(supported_assets @@ -119,8 +123,10 @@ where gas_amount, cf_parameters, }) => { - let CfParameters { ccm_additional_data, vault_swap_parameters } = - CcmCfParameters::decode(&mut &cf_parameters[..])?; + let VersionedCcmCfParameters::V0(CfParameters { + ccm_additional_data, + vault_swap_parameters, + }) = VersionedCcmCfParameters::decode(&mut &cf_parameters[..])?; Some(CallBuilder::vault_swap_request( native_asset, @@ -161,8 +167,10 @@ where gas_amount, cf_parameters, }) => { - let CfParameters { ccm_additional_data, vault_swap_parameters } = - CcmCfParameters::decode(&mut &cf_parameters[..])?; + let VersionedCcmCfParameters::V0(CfParameters { + ccm_additional_data, + vault_swap_parameters, + }) = VersionedCcmCfParameters::decode(&mut &cf_parameters[..])?; Some(CallBuilder::vault_swap_request( *(supported_assets