Skip to content

Commit

Permalink
Clean challenge-base (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianalarcon authored Aug 8, 2024
1 parent b037fe4 commit 66a02bd
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 136 deletions.
2 changes: 0 additions & 2 deletions packages/nextjs/utils/scaffold-stark/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ export type ExtractAbiFunctionScaffold<
}
>;

// let emerson = singleFunction extends listOfFunctions ? true : false;

export type UseScaffoldArgsParam<
TContractName extends ContractName,
TFunctionName extends ExtractAbiFunctionNamesScaffold<
Expand Down
2 changes: 1 addition & 1 deletion packages/snfoundry/contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2023_11"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "=2.6.4"
starknet = "2.6.4"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.14.0" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" }

Expand Down
105 changes: 0 additions & 105 deletions packages/snfoundry/contracts/src/YourContract.cairo

This file was deleted.

1 change: 0 additions & 1 deletion packages/snfoundry/contracts/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod YourContract;
#[cfg(test)]
mod test {
mod TestContract;
Expand Down
27 changes: 0 additions & 27 deletions packages/snfoundry/contracts/src/test/TestContract.cairo
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
use contracts::YourContract::{IYourContractDispatcher, IYourContractDispatcherTrait};
use openzeppelin::utils::serde::SerializedAppend;
use snforge_std::{declare, ContractClassTrait};
use starknet::ContractAddress;

fn deploy_contract(name: ByteArray) -> ContractAddress {
let contract = declare(name).unwrap();
let mut calldata = array![];
calldata.append_serde(0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca);
let (contract_address, _) = contract.deploy(@calldata).unwrap();
contract_address
}

#[test]
fn test_deployment_values() {
let contract_address = deploy_contract("YourContract");

let dispatcher = IYourContractDispatcher { contract_address };

let current_gretting = dispatcher.gretting();
let expected_gretting: ByteArray = "Building Unstoppable Apps!!!";
assert_eq!(current_gretting, expected_gretting, "Should have the right message on deploy");

let new_greeting: ByteArray = "Learn Scaffold-Stark 2! :)";
dispatcher.set_gretting(new_greeting.clone(), 0); // we transfer 0 eth

assert_eq!(dispatcher.gretting(), new_greeting, "Should allow setting a new message");
}

0 comments on commit 66a02bd

Please sign in to comment.