From 4aa76bafa3fbae6471e6f4a719f2399b599741d1 Mon Sep 17 00:00:00 2001 From: byteZorvin Date: Thu, 26 Sep 2024 18:33:09 +0530 Subject: [PATCH] to be fixed: validation error --- crates/settlement-clients/starknet/src/lib.rs | 2 +- .../src/tests/mock_contracts/src/lib.cairo | 14 +++++- .../starknet/src/tests/test.rs | 45 +++++++++---------- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/crates/settlement-clients/starknet/src/lib.rs b/crates/settlement-clients/starknet/src/lib.rs index fd6bf6b9..95cd5485 100644 --- a/crates/settlement-clients/starknet/src/lib.rs +++ b/crates/settlement-clients/starknet/src/lib.rs @@ -70,7 +70,7 @@ impl StarknetSettlementClient { signer.clone(), signer_address, provider.chain_id().await.unwrap(), - ExecutionEncoding::Legacy, + ExecutionEncoding::New )); let starknet_core_contract_client: StarknetCoreContractClient = diff --git a/crates/settlement-clients/starknet/src/tests/mock_contracts/src/lib.cairo b/crates/settlement-clients/starknet/src/tests/mock_contracts/src/lib.cairo index c89eeed2..7f1d1bf2 100644 --- a/crates/settlement-clients/starknet/src/tests/mock_contracts/src/lib.cairo +++ b/crates/settlement-clients/starknet/src/tests/mock_contracts/src/lib.cairo @@ -1,6 +1,11 @@ #[starknet::interface] pub trait IPiltover { - fn update_state(self: @TContractState); + fn update_state( + ref self: TContractState, + program_output: Span, + onchain_data_hash: felt252, + onchain_data_size: u256 + ); } #[starknet::contract] @@ -12,6 +17,11 @@ mod Piltover { #[abi(embed_v0)] impl IPiltoverImpl of super::IPiltover { - fn update_state(self: @ContractState) {} + fn update_state( + ref self: ContractState, + program_output: Span, + onchain_data_hash: felt252, + onchain_data_size: u256 + ) {} } } diff --git a/crates/settlement-clients/starknet/src/tests/test.rs b/crates/settlement-clients/starknet/src/tests/test.rs index 4cacc425..669974d8 100644 --- a/crates/settlement-clients/starknet/src/tests/test.rs +++ b/crates/settlement-clients/starknet/src/tests/test.rs @@ -77,14 +77,7 @@ async fn setup() -> SingleOwnerAccount, LocalWallet let address = Felt::from_hex(&env_settings.get_settings_or_panic("STARKNET_PUBLIC_KEY")).unwrap(); let chain_id = provider.chain_id().await.unwrap(); - println!("address {:?}", env_settings.get_settings_or_panic("STARKNET_PUBLIC_KEY")); - let mut account = SingleOwnerAccount::new( - provider, - signer, - address, - chain_id, - ExecutionEncoding::New, - ); + let mut account = SingleOwnerAccount::new(provider, signer, address, chain_id, ExecutionEncoding::New); // `SingleOwnerAccount` defaults to checking nonce and estimating fees against the latest // block. Optionally change the target block to pending with the following line: @@ -123,11 +116,7 @@ async fn test_deployment(#[future] setup: SingleOwnerAccount