Skip to content

Commit 1e62a79

Browse files
committed
fix(ts-template): small fixes to deploy scripts
1 parent dd4eb8e commit 1e62a79

File tree

9 files changed

+72
-43
lines changed

9 files changed

+72
-43
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.2.7] - 2024-11-19
6+
7+
### 🐛 Bug Fixes
8+
9+
- *(ts-template)* Small fixes to deploy scripts
10+
511
## [0.2.6] - 2024-11-19
612

713
### 🐛 Bug Fixes
814

9-
- *(legacy-init)* Fix greeting task template
15+
- *(legacy-init)* Fix greeting task in template
16+
17+
### ⚙️ Miscellaneous Tasks
18+
19+
- Release version v0.2.6
1020

1121
## [0.2.5] - 2024-11-19
1222

1323
### 🐛 Bug Fixes
1424

1525
- *(legacy-init)* Change Cargo.toml -> Cargo.toml.txt to avoid publishing problems
16-
- *(legacy-init)* Fix template pathes
26+
- *(legacy-init)* Fix template paths
1727

1828
### ⚙️ Miscellaneous Tasks
1929

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include = [
99
license = "MIT"
1010
name = "gblend"
1111
repository = "https://github.com/fluentlabs-xyz/gblend"
12-
version = "0.2.6"
12+
version = "0.2.7"
1313

1414
[dependencies]
1515
anyhow = "1.0.86"

src/commands/legacy_init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ fn spin_ts(use_erc20: bool) -> Result<()> {
202202
));
203203
const SOL_SCRIPT: &str = include_str!(concat!(
204204
env!("CARGO_MANIFEST_DIR"),
205-
"/templates/ts-template/deploy.ts"
205+
"/templates/ts-template/deploy-solidity.ts"
206206
));
207207
const VYPER_SCRIPT: &str = include_str!(concat!(
208208
env!("CARGO_MANIFEST_DIR"),
209-
"/templates/ts-template/deployvyper.ts"
209+
"/templates/ts-template/deploy-vyper.ts"
210210
));
211211
create_file_with_content("contracts/hello.sol", SOL_SC)?;
212212
create_file_with_content("contracts/hello-v.vy", VYPER_SC)?;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { ethers } from "hardhat";
2+
3+
async function main() {
4+
const [deployer] = await ethers.getSigners();
5+
const network = await ethers.provider.getNetwork();
6+
7+
console.log("Deploying contract...");
8+
console.log("Chain ID:", network.chainId);
9+
console.log("Deployer address:", deployer.address);
10+
console.log(
11+
"Deployer balance:",
12+
ethers.utils.formatEther(await deployer.getBalance()),
13+
"ETH"
14+
);
15+
16+
const ContractFactory = await ethers.getContractFactory("Hello");
17+
const contract = await ContractFactory.deploy();
18+
19+
// Access the address property directly
20+
console.log("Contract address:", contract.address);
21+
}
22+
23+
main()
24+
.then(() => process.exit(0))
25+
.catch((error) => {
26+
console.error(error);
27+
process.exit(1);
28+
});

templates/ts-template/deploy-vyper.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { ethers } from "hardhat";
2+
3+
async function main() {
4+
const [deployer] = await ethers.getSigners();
5+
const network = await ethers.provider.getNetwork();
6+
7+
console.log("Deploying contract...");
8+
console.log("Chain ID:", network.chainId);
9+
console.log("Deployer address:", deployer.address);
10+
console.log(
11+
"Deployer balance:",
12+
ethers.utils.formatEther(await deployer.getBalance()),
13+
"ETH"
14+
);
15+
16+
const ContractFactory = await ethers.getContractFactory("hello-v");
17+
const contract = await ContractFactory.deploy();
18+
19+
// Access the address property directly
20+
console.log("Contract address:", contract.address);
21+
}
22+
23+
main()
24+
.then(() => process.exit(0))
25+
.catch((error) => {
26+
console.error(error);
27+
process.exit(1);
28+
});

templates/ts-template/deploy.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

templates/ts-template/deployvyper.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/commands/rust/init_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ fn test_init_with_template() -> Result<(), Box<dyn std::error::Error>> {
7575
}
7676

7777
#[test]
78-
#[ignore]
7978
fn test_init_fails_with_invalid_template() -> Result<(), Box<dyn std::error::Error>> {
8079
let project = TestProject::new()?;
8180

0 commit comments

Comments
 (0)