Skip to content

Commit 7c13ffd

Browse files
pgherveoududo50
authored andcommitted
[pallet-revive] fix file case (paritytech#6981)
fix paritytech#6970 --------- Co-authored-by: command-bot <>
1 parent 7f5e527 commit 7c13ffd

File tree

8 files changed

+37
-136
lines changed

8 files changed

+37
-136
lines changed

prdoc/pr_6981.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: '[pallet-revive] fix file case'
2+
doc:
3+
- audience: Runtime Dev
4+
description: "fix https://github.com/paritytech/polkadot-sdk/issues/6970\r\n"
5+
crates:
6+
- name: pallet-revive-eth-rpc
7+
bump: minor

substrate/frame/revive/rpc/examples/js/abi/ErrorTester.json renamed to substrate/frame/revive/rpc/examples/js/abi/Errors.json

File renamed without changes.

substrate/frame/revive/rpc/examples/js/abi/ErrorTester.ts renamed to substrate/frame/revive/rpc/examples/js/abi/Errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const ErrorTesterAbi = [
1+
export const ErrorsAbi = [
22
{
33
inputs: [
44
{

substrate/frame/revive/rpc/examples/js/abi/errorTester.ts

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

substrate/frame/revive/rpc/examples/js/contracts/ErrorTester.sol renamed to substrate/frame/revive/rpc/examples/js/contracts/Errors.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4-
contract ErrorTester {
4+
contract Errors {
55
bool public state;
66

77
// Payable function that can be used to test insufficient funds errors

substrate/frame/revive/rpc/examples/js/pvm/ErrorTester.polkavm renamed to substrate/frame/revive/rpc/examples/js/pvm/Errors.polkavm

File renamed without changes.

substrate/frame/revive/rpc/examples/js/src/geth-diff.test.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { jsonRpcErrors, procs, createEnv, getByteCode } from './geth-diff-setup.ts'
22
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test'
33
import { encodeFunctionData, Hex, parseEther } from 'viem'
4-
import { ErrorTesterAbi } from '../abi/ErrorTester'
4+
import { ErrorsAbi } from '../abi/Errors'
55
import { FlipperCallerAbi } from '../abi/FlipperCaller'
66
import { FlipperAbi } from '../abi/Flipper'
77

@@ -17,19 +17,19 @@ const envs = await Promise.all([createEnv('geth'), createEnv('kitchensink')])
1717

1818
for (const env of envs) {
1919
describe(env.serverWallet.chain.name, () => {
20-
let errorTesterAddr: Hex = '0x'
20+
let errorsAddr: Hex = '0x'
2121
let flipperAddr: Hex = '0x'
2222
let flipperCallerAddr: Hex = '0x'
2323
beforeAll(async () => {
2424
{
2525
const hash = await env.serverWallet.deployContract({
26-
abi: ErrorTesterAbi,
27-
bytecode: getByteCode('errorTester', env.evm),
26+
abi: ErrorsAbi,
27+
bytecode: getByteCode('errors', env.evm),
2828
})
2929
const deployReceipt = await env.serverWallet.waitForTransactionReceipt({ hash })
3030
if (!deployReceipt.contractAddress)
3131
throw new Error('Contract address should be set')
32-
errorTesterAddr = deployReceipt.contractAddress
32+
errorsAddr = deployReceipt.contractAddress
3333
}
3434

3535
{
@@ -60,8 +60,8 @@ for (const env of envs) {
6060
expect.assertions(3)
6161
try {
6262
await env.accountWallet.readContract({
63-
address: errorTesterAddr,
64-
abi: ErrorTesterAbi,
63+
address: errorsAddr,
64+
abi: ErrorsAbi,
6565
functionName: 'triggerAssertError',
6666
})
6767
} catch (err) {
@@ -78,8 +78,8 @@ for (const env of envs) {
7878
expect.assertions(3)
7979
try {
8080
await env.accountWallet.readContract({
81-
address: errorTesterAddr,
82-
abi: ErrorTesterAbi,
81+
address: errorsAddr,
82+
abi: ErrorsAbi,
8383
functionName: 'triggerRevertError',
8484
})
8585
} catch (err) {
@@ -96,8 +96,8 @@ for (const env of envs) {
9696
expect.assertions(3)
9797
try {
9898
await env.accountWallet.readContract({
99-
address: errorTesterAddr,
100-
abi: ErrorTesterAbi,
99+
address: errorsAddr,
100+
abi: ErrorsAbi,
101101
functionName: 'triggerDivisionByZero',
102102
})
103103
} catch (err) {
@@ -116,8 +116,8 @@ for (const env of envs) {
116116
expect.assertions(3)
117117
try {
118118
await env.accountWallet.readContract({
119-
address: errorTesterAddr,
120-
abi: ErrorTesterAbi,
119+
address: errorsAddr,
120+
abi: ErrorsAbi,
121121
functionName: 'triggerOutOfBoundsError',
122122
})
123123
} catch (err) {
@@ -136,8 +136,8 @@ for (const env of envs) {
136136
expect.assertions(3)
137137
try {
138138
await env.accountWallet.readContract({
139-
address: errorTesterAddr,
140-
abi: ErrorTesterAbi,
139+
address: errorsAddr,
140+
abi: ErrorsAbi,
141141
functionName: 'triggerCustomError',
142142
})
143143
} catch (err) {
@@ -154,8 +154,8 @@ for (const env of envs) {
154154
expect.assertions(3)
155155
try {
156156
await env.accountWallet.simulateContract({
157-
address: errorTesterAddr,
158-
abi: ErrorTesterAbi,
157+
address: errorsAddr,
158+
abi: ErrorsAbi,
159159
functionName: 'valueMatch',
160160
value: parseEther('10'),
161161
args: [parseEther('10')],
@@ -187,8 +187,8 @@ for (const env of envs) {
187187
expect.assertions(3)
188188
try {
189189
await env.accountWallet.estimateContractGas({
190-
address: errorTesterAddr,
191-
abi: ErrorTesterAbi,
190+
address: errorsAddr,
191+
abi: ErrorsAbi,
192192
functionName: 'valueMatch',
193193
value: parseEther('10'),
194194
args: [parseEther('10')],
@@ -205,8 +205,8 @@ for (const env of envs) {
205205
expect.assertions(3)
206206
try {
207207
await env.accountWallet.estimateContractGas({
208-
address: errorTesterAddr,
209-
abi: ErrorTesterAbi,
208+
address: errorsAddr,
209+
abi: ErrorsAbi,
210210
functionName: 'valueMatch',
211211
value: parseEther('10'),
212212
args: [parseEther('10')],
@@ -223,8 +223,8 @@ for (const env of envs) {
223223
expect.assertions(3)
224224
try {
225225
await env.serverWallet.estimateContractGas({
226-
address: errorTesterAddr,
227-
abi: ErrorTesterAbi,
226+
address: errorsAddr,
227+
abi: ErrorsAbi,
228228
functionName: 'valueMatch',
229229
value: parseEther('11'),
230230
args: [parseEther('10')],
@@ -255,8 +255,8 @@ for (const env of envs) {
255255
expect(balance).toBe(0n)
256256

257257
await env.accountWallet.estimateContractGas({
258-
address: errorTesterAddr,
259-
abi: ErrorTesterAbi,
258+
address: errorsAddr,
259+
abi: ErrorsAbi,
260260
functionName: 'setState',
261261
args: [true],
262262
})
@@ -273,7 +273,7 @@ for (const env of envs) {
273273
expect(balance).toBe(0n)
274274

275275
const data = encodeFunctionData({
276-
abi: ErrorTesterAbi,
276+
abi: ErrorsAbi,
277277
functionName: 'setState',
278278
args: [true],
279279
})
@@ -284,7 +284,7 @@ for (const env of envs) {
284284
{
285285
data,
286286
from: env.accountWallet.account.address,
287-
to: errorTesterAddr,
287+
to: errorsAddr,
288288
},
289289
],
290290
})

substrate/frame/revive/rpc/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async fn deploy_and_call() -> anyhow::Result<()> {
222222
async fn revert_call() -> anyhow::Result<()> {
223223
let _lock = SHARED_RESOURCES.write();
224224
let client = SharedResources::client().await;
225-
let (bytecode, contract) = get_contract("ErrorTester")?;
225+
let (bytecode, contract) = get_contract("Errors")?;
226226
let receipt = TransactionBuilder::default()
227227
.input(bytecode)
228228
.send_and_wait_for_receipt(&client)

0 commit comments

Comments
 (0)