-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into add-diagrams
- Loading branch information
Showing
6 changed files
with
167 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,21 @@ jobs: | |
|
||
- name: Step 3 - Check correct linting | ||
run: yarn eslint . | ||
|
||
gas-report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out main branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Scarb | ||
uses: software-mansion/[email protected] | ||
|
||
- name: Install project | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Start devnet in background | ||
run: scarb run start-devnet | ||
|
||
- name: Gas report | ||
run: scarb run profile --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod constants; | ||
mod setup; | ||
mod test_claim_hash; | ||
mod test_deposit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use argent_gifting::contracts::gift_factory::{IGiftFactoryDispatcherTrait}; | ||
use openzeppelin::token::erc20::interface::{IERC20Dispatcher, IERC20DispatcherTrait}; | ||
use snforge_std::{start_cheat_caller_address}; | ||
use super::constants::DEPOSITOR; | ||
use super::setup::{GiftingSetup, deploy_gifting_broken_erc20}; | ||
|
||
#[test] | ||
#[should_panic(expected: ('gift-fac/transfer-failed',))] | ||
fn test_deposit_same_token_failing_transfer() { | ||
let GiftingSetup { .., mock_strk, gift_factory, escrow_class_hash } = deploy_gifting_broken_erc20(); | ||
gift_factory.deposit(escrow_class_hash, mock_strk.contract_address, 101, mock_strk.contract_address, 100, 12); | ||
} | ||
|
||
#[test] | ||
#[should_panic(expected: ('gift-fac/transfer-gift-failed',))] | ||
fn test_deposit_different_token_failing_gift_transfer() { | ||
let GiftingSetup { mock_eth, mock_strk, gift_factory, escrow_class_hash } = deploy_gifting_broken_erc20(); | ||
let broken_erc20 = mock_strk; | ||
start_cheat_caller_address(gift_factory.contract_address, DEPOSITOR()); | ||
gift_factory.deposit(escrow_class_hash, broken_erc20.contract_address, 100, mock_eth.contract_address, 100, 42); | ||
} | ||
|
||
#[test] | ||
#[should_panic(expected: ('gift-fac/transfer-fee-failed',))] | ||
fn test_deposit_different_token_failing_fee_transfer() { | ||
let GiftingSetup { mock_eth, mock_strk, gift_factory, escrow_class_hash } = deploy_gifting_broken_erc20(); | ||
let broken_erc20 = mock_strk; | ||
start_cheat_caller_address(gift_factory.contract_address, DEPOSITOR()); | ||
gift_factory.deposit(escrow_class_hash, mock_eth.contract_address, 100, broken_erc20.contract_address, 100, 42); | ||
} |