Skip to content

Commit 641f057

Browse files
fix: Support global contract attribute macro paths in integration tests contract checker script (#2512)
* fix: Support global contract attribute macro paths in `scripts/is_contract.sh` checker * fix: `trait-flipper` integration test
1 parent 641342d commit 641f057

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

integration-tests/public/trait-flipper/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ pub mod flipper {
4848
#[::ink::test]
4949
fn default_works() {
5050
let flipper = Flipper::new();
51-
assert!(!flipper.get());
51+
assert!(flipper.get());
5252
}
5353

5454
#[::ink::test]
5555
fn it_works() {
5656
let mut flipper = Flipper::new();
5757
// Can call using universal call syntax using the trait.
58-
assert!(!<Flipper as Flip>::get(&flipper));
58+
assert!(<Flipper as Flip>::get(&flipper));
5959
<Flipper as Flip>::flip(&mut flipper);
6060
// Normal call syntax possible to as long as the trait is in scope.
61-
assert!(flipper.get());
61+
assert!(!flipper.get());
6262
}
6363
}
6464
}

scripts/is_contract.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ -z "$SOURCE_PATH" ]; then
4343
fi
4444

4545
# Check for the #[ink::contract] macro in the source file
46-
if grep -q '^#\[ink::contract\([^]]*\)\]' "$SOURCE_PATH"; then
46+
if grep -qE '^#\[(::)?ink::contract([^]]*)\]' "$SOURCE_PATH"; then
4747
exit 0
4848
else
4949
exit 1

0 commit comments

Comments
 (0)