Update dependencies (#70)

Updates hardhat and solidity

Uses personal_sign instead of eth_sign, because ethers.js also uses personal_sign, and eth_sign is now broken in hardhat (arguments are reversed).

Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
This commit is contained in:
markspanbroek 2024-05-13 11:51:43 +02:00 committed by GitHub
parent bcb539148a
commit 4ad5b6065e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 5586 additions and 1691 deletions

View File

@ -18,7 +18,7 @@ jobs:
- name: Install NodeJS - name: Install NodeJS
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: '14' node-version: '18'
- name: Install test node - name: Install test node
working-directory: testnode working-directory: testnode
run: npm install run: npm install

View File

@ -327,7 +327,7 @@ method signMessage*(
convertSignerError: convertSignerError:
let client = await signer.provider.client let client = await signer.provider.client
let address = await signer.getAddress() let address = await signer.getAddress()
return await client.eth_sign(address, message) return await client.personal_sign(message, address)
method sendTransaction*( method sendTransaction*(
signer: JsonRpcSigner, signer: JsonRpcSigner,

View File

@ -1,4 +1,5 @@
proc net_version(): string proc net_version(): string
proc personal_sign(message: seq[byte], account: Address): seq[byte]
proc eth_accounts: seq[Address] proc eth_accounts: seq[Address]
proc eth_blockNumber: UInt256 proc eth_blockNumber: UInt256
proc eth_call(transaction: Transaction, blockTag: BlockTag): seq[byte] proc eth_call(transaction: Transaction, blockTag: BlockTag): seq[byte]
@ -13,7 +14,6 @@ proc eth_chainId(): UInt256
proc eth_sendTransaction(transaction: Transaction): TransactionHash proc eth_sendTransaction(transaction: Transaction): TransactionHash
proc eth_sendRawTransaction(data: seq[byte]): TransactionHash proc eth_sendRawTransaction(data: seq[byte]): TransactionHash
proc eth_getTransactionReceipt(hash: TransactionHash): ?TransactionReceipt proc eth_getTransactionReceipt(hash: TransactionHash): ?TransactionReceipt
proc eth_sign(account: Address, message: seq[byte]): seq[byte]
proc eth_subscribe(name: string, filter: EventFilter): JsonNode proc eth_subscribe(name: string, filter: EventFilter): JsonNode
proc eth_subscribe(name: string): JsonNode proc eth_subscribe(name: string): JsonNode
proc eth_unsubscribe(id: JsonNode): bool proc eth_unsubscribe(id: JsonNode): bool

View File

@ -28,7 +28,7 @@ for url in ["ws://localhost:8545", "http://localhost:8545"]:
test "sends raw messages to the provider": test "sends raw messages to the provider":
let response = await provider.send("evm_mine") let response = await provider.send("evm_mine")
check response == %"0x0" check response == %"0"
test "returns block number": test "returns block number":
let blocknumber1 = await provider.getBlockNumber() let blocknumber1 = await provider.getBlockNumber()

View File

@ -2,7 +2,7 @@ require("hardhat-deploy")
require("hardhat-deploy-ethers") require("hardhat-deploy-ethers")
module.exports = { module.exports = {
solidity: "0.8.11", solidity: "0.8.24",
namedAccounts: { namedAccounts: {
deployer: { default: 0 } deployer: { default: 0 }
} }

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,10 @@
"name": "hardhat-project", "name": "hardhat-project",
"devDependencies": { "devDependencies": {
"@openzeppelin/contracts": "^4.4.2", "@openzeppelin/contracts": "^4.4.2",
"ethers": "^5.5.3", "ethers": "^6.11.1",
"hardhat": "^2.8.3", "hardhat": "^2.22.1",
"hardhat-deploy": "^0.9.24", "hardhat-deploy": "^0.11.34",
"hardhat-deploy-ethers": "^0.3.0-beta.13" "hardhat-deploy-ethers": "^0.4.1"
}, },
"scripts": { "scripts": {
"start": "hardhat node --export 'deployment.json'" "start": "hardhat node --export 'deployment.json'"