Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

fix: remove unecessary checks before tx execution #1627

Merged

Conversation

tdelabro
Copy link
Collaborator

@tdelabro tdelabro commented Jun 5, 2024

By removing those checks we will return same errors are Starknet rather than our customs ones (when we will be able to return complex errors from runtime)

@@ -576,17 +568,6 @@ pub mod pallet {
// This ensures that the function can only be called via unsigned transaction.
ensure_none(origin)?;

// Check class hash is not already declared
ensure!(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what happens if its already declared, does it fail or it just overrides?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -146,7 +146,7 @@ fn given_contract_declare_tx_works_once_not_twice() {
assert_eq!(Starknet::contract_class_by_class_hash(class_hash.0).unwrap(), contract_class);
// TODO: Uncomment once we have ABI support
// assert_eq!(Starknet::contract_class_by_class_hash(erc20_class_hash), erc20_class);
assert_err!(Starknet::declare(none_origin, transaction), Error::<MockRuntime>::ClassHashAlreadyDeclared);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@apoorvsadana it fails

@tdelabro tdelabro merged commit 271287e into keep-starknet-strange:main Jun 6, 2024
15 checks passed
@tdelabro tdelabro deleted the remove-duplicate-checks branch June 6, 2024 09:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants