Closed chunteng-web3 closed 1 year ago
On a closer look, I don't think this actually makes a difference:
if you look under node_modules/.bin
, you'll find typechain-polkadot
and typechain-compiler
executables, regardless of the prefix.
npx
will first look there.
Did changing this in code make any difference for you?
On a closer look, I don't think this actually makes a difference: if you look under
node_modules/.bin
, you'll findtypechain-polkadot
andtypechain-compiler
executables, regardless of the prefix.npx
will first look there. Did changing this in code make any difference for you?
Yes it did as the command compiles contracts properly now while the latest release version (2.1.2) would not compile contracts on my laptop yesterday, and that's why I went to this fix.
However, as I tried with my desktop today, 2.1.2 is compiling properly now. Maybe anything relevant to caches?
Most probably.
I believe what happened was, when you ran the npx command with the @727-ventures
prefix, it just downloaded the newer 1.0.0-beta version.
I was just testing it with a project, and it wouldn't compile until I:
@polkadot/*
packagesresolutions
field from package.jsonyarn
swanky compile
again.Can you confirm you're able to do the same, without the changes in this PR?
(make sure to use:
"@727-ventures/typechain-polkadot": "1.0.0-beta.2",
"@727-ventures/typechain-types": "^1.0.0-beta.1",
Most probably. I believe what happened was, when you ran the npx command with the
@727-ventures
prefix, it just downloaded the newer 1.0.0-beta version. I was just testing it with a project, and it wouldn't compile until I:
- deleted node_modules, and yarn.lock,
- remove all direct dependencies to
@polkadot/*
packages- remove the
resolutions
field from package.json- reinstalled deps with
yarn
- ran the
swanky compile
again.Can you confirm you're able to do the same, without the changes in this PR?
(make sure to use:
"@727-ventures/typechain-polkadot": "1.0.0-beta.2", "@727-ventures/typechain-types": "^1.0.0-beta.1",
Sure!
swanky version
node_modules
, yarn.lock
, package.lock.json
so this is my current package.json:
{
"name": "aave-v2",
"version": "1.0.0",
"author": "chunteng-web3 <chunteng@astriddao.xyz>",
"license": "MIT",
"scripts": {
"run-node": "swanky node start",
"test": "mocha -r ts-node/register \"test/**/*.test.ts\" --exit --timeout 20000"
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@727-ventures/typechain-polkadot": "1.0.0-beta.2",
"@727-ventures/typechain-types": "^1.0.0-beta.1",
"typescript": "^4.9.3"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/chai-as-promised": "^7.1.5",
"@types/mocha": "^8.0.3",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"mocha": "10.1.0",
"mochawesome": "^7.1.3",
"ts-node": "^10.8.0",
"ethereum-waffle": "3.0.2",
"ethereumjs-util": "7.0.2",
"bignumber.js": "^9.1.1",
"lowdb": "1.0.0",
"@types/lowdb": "1.0.9",
"ethers": "^5.0.19"
}
}
swanky compile
again.And it failed.
I did the same thing again with 2.1.2, and it's passing.
oh, but that's ok - version 2.1.2 has a fix for that - what I meant, it works without the changes in this PR?
oh, but that's ok - version 2.1.2 has a fix for that - what I meant, it works without the changes in this PR?
Yes it does as I was not using my local version of it.
Ok, in that case I'll close the pr 👍
As I intrusively debug, the command used at #L137 of swanky-cli/packages/core/src/lib/command-utils.ts might be outdated.
The command used:
but the correct command on Brushfam/typechain-polkadot is
Note: The only modification from me was made in 962fa24eebfa0b193bab54e491e5bc18584f2f46 while ad6de1bf494fcd198e9d8cfdf75990514842f098 was automatically generated by
npx lerna publish --no-private
Please adjust as you wish.
With the modification, the ts gen seems running properly.
I called
swanky contract compile CONTRACT_NAME
this way: