Skip to content

Commit

Permalink
fix: processing solidity-example template (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Nov 4, 2024
1 parent c29c59d commit 9b8a22e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-boats-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

fix: processing solidity-example template
12 changes: 10 additions & 2 deletions src/tasks/copy-template-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,19 @@ export async function copyTemplateFiles(options: Options, templateDir: string, t
await copyExtensionFiles(options, externalExtensionPath, targetDir);
}

if (!options.externalExtension && options.solidityFramework && exampleContractsPath) {
const shouldCopyExampleContracts = !options.externalExtension && options.solidityFramework && exampleContractsPath;
if (shouldCopyExampleContracts) {
await copyExtensionFiles(options, exampleContractsPath, targetDir);
}

// 4. Process templated files and generate output
await processTemplatedFiles(options, basePath, solidityFrameworkPath, exampleContractsPath, targetDir);
await processTemplatedFiles(
options,
basePath,
solidityFrameworkPath,
shouldCopyExampleContracts ? exampleContractsPath : null,
targetDir,
);

// 5. Delete tmp directory
if (options.externalExtension && !options.dev) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
pragma solidity ^0.8.13;

import "forge-std/Test.sol";
import "../contracts/YourContract.sol";
// import "../contracts/YourContract.sol";

contract YourContractTest is Test {
YourContract public yourContract;
/* YourContract public yourContract;
function setUp() public {
yourContract = new YourContract(vm.addr(1));
Expand All @@ -16,13 +16,5 @@ contract YourContractTest is Test {
keccak256(bytes(yourContract.greeting()))
== keccak256("Building Unstoppable Apps!!!")
);
}

function testSetNewMessage() public {
yourContract.setGreeting("Learn Scaffold-ETH 2! :)");
require(
keccak256(bytes(yourContract.greeting()))
== keccak256("Learn Scaffold-ETH 2! :)")
);
}
} */
}

0 comments on commit 9b8a22e

Please sign in to comment.