Skip to content

chore: test contract deployment with salt #1658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions e2e/tests/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,45 @@ async fn test_multiple_args() -> Result<()> {
Ok(())
}

#[tokio::test]
async fn contract_deployment_with_salt() {
setup_program_test!(
Wallets("wallet"),
Abigen(Contract(
name = "TestContract",
project = "e2e/sway/contracts/contract_test"
)),
Deploy(
name = "contract_instance_1",
contract = "TestContract",
wallet = "wallet",
random_salt = false,
),
Deploy(
name = "contract_instance_2",
contract = "TestContract",
wallet = "wallet",
random_salt = false,
),
Deploy(
name = "contract_instance_3",
contract = "TestContract",
wallet = "wallet",
random_salt = true,
),
);

assert_eq!(
contract_instance_1.contract_id(),
contract_instance_2.contract_id()
);

assert_ne!(
contract_instance_1.contract_id(),
contract_instance_3.contract_id()
);
}

#[tokio::test]
async fn test_contract_calling_contract() -> Result<()> {
// Tests a contract call that calls another contract (FooCaller calls FooContract underneath)
Expand Down
Loading