Skip to content

Commit

Permalink
Bump snforge, unignore tests (#1203)
Browse files Browse the repository at this point in the history
* bump snforge

* remove ignores

* tidy up code

* add entry to changelog

* use scarbs for snforge dep

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

---------

Co-authored-by: Eric Nordelo <[email protected]>
  • Loading branch information
andrew-fleming and ericnordelo authored Nov 13, 2024
1 parent fcace70 commit 399654f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- SRC9 (Outside Execution) integration to account presets (#1201)

### Changed (Breaking)

- Bump snforge_std to v0.33.0 (#1203)

## 0.19.0 (2024-11-08)

### Added
Expand Down
8 changes: 4 additions & 4 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ dependencies = [

[[package]]
name = "snforge_scarb_plugin"
version = "0.31.0"
version = "0.33.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1fce075fcbf7fce1b0935f6f9a034549704837fb221da212d3b6e9134cebfdaa"
checksum = "sha256:b4dd6088372decd367652827091e0589bbf6bc550dfc3957baa3e9c61d6eb449"

[[package]]
name = "snforge_std"
version = "0.31.0"
version = "0.33.0"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:60ac980b297281f9a59a5f1668cb56bdea1b28fd2f8008008270f9a3c91ad3ba"
checksum = "sha256:f7dc3349f8a6ef4915c93df447a00bd5a53a31129fd0990a00afa0ad31d91b06"
dependencies = [
"snforge_scarb_plugin",
]
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ keywords = [
[workspace.dependencies]
assert_macros = "2.8.4"
starknet = "2.8.4"
snforge_std = "0.31.0"
snforge_std = "0.33.0"

[dependencies]
starknet.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions packages/governance/src/tests/test_timelock.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ fn test_execute_failing_tx() {
}

#[test]
#[ignore] // REASON: should_panic attribute not fit for complex panic messages.
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND',))]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED'))]
fn test_execute_bad_selector() {
let (mut timelock, mut target) = setup_dispatchers();
let predecessor = NO_PREDECESSOR;
Expand Down
6 changes: 2 additions & 4 deletions packages/presets/src/tests/test_erc721.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ fn test_safeTransferFrom_to_receiver_failure() {
}

#[test]
#[ignore] // REASON: foundry entrypoint_not_found error message inconsistent with mainnet.
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND',))]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED'))]
fn test_safe_transfer_from_to_non_receiver() {
let (_, dispatcher) = setup_dispatcher();
let recipient = utils::declare_and_deploy("NonImplementingMock", array![]);
Expand All @@ -569,8 +568,7 @@ fn test_safe_transfer_from_to_non_receiver() {
}

#[test]
#[ignore] // REASON: foundry entrypoint_not_found error message inconsistent with mainnet.
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND',))]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED'))]
fn test_safeTransferFrom_to_non_receiver() {
let (_, dispatcher) = setup_dispatcher();
let recipient = utils::declare_and_deploy("NonImplementingMock", array![]);
Expand Down
8 changes: 2 additions & 6 deletions packages/upgrades/src/tests/test_upgradeable.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,12 @@ fn test_upgrade_and_call_with_no_return_value() {
}

#[test]
#[ignore] // REASON: safe dispatcher does not catch syscall error in SN Forge
#[feature("safe_dispatcher")]
#[should_panic(expected: ('ENTRYPOINT_NOT_FOUND', 'ENTRYPOINT_FAILED'))]
fn test_upgrade_and_call_with_removed_selector() {
let (v1, v2_class) = setup_test();
let removed_selector = selector!("remove_selector");
let calldata = array![];

// We use the v1 dispatcher because `remove_selector` is not in v2 interface
let safe_dispatcher = IUpgradesV1SafeDispatcher { contract_address: v1.contract_address };
let mut result = safe_dispatcher
.upgrade_and_call(v2_class.class_hash, removed_selector, calldata.span());
utils::assert_entrypoint_not_found_error(result, removed_selector, v1.contract_address);
v1.upgrade_and_call(v2_class.class_hash, removed_selector, calldata.span());
}

0 comments on commit 399654f

Please sign in to comment.