Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add regression tests for issues MOON-2822 MOON-2824 #2781

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RomarQ
Copy link
Contributor

@RomarQ RomarQ commented Apr 24, 2024

What does it do?

Adds regression tests for recent eth_call errors

@RomarQ RomarQ self-assigned this Apr 24, 2024
@RomarQ RomarQ added B0-silent Changes should not be mentioned in any release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit labels Apr 24, 2024
Copy link
Contributor

@timbrinded timbrinded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to instead design the smoke test to generically collect all of our "bad block regressions" as this has happened in the past with alpha net too. This smoke test should have a const record of chain, block, query/call and then verify against an expected result


it({
id: "C001",
title: "Verify MOON-2824",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give a more descriptive title so we dont have to copy and paste that into jira each time

},
);

expect(result).to.contain("0x");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want the response result to be 0x use toBe("0x") as contain will do partial matches

functionName: "balanceOf",
args: ["0x30763be2bf075c3fDeA704c5f59A76d011d02943", 2],
});
const result = await (context.ethers().provider as ethers.JsonRpcProvider).call(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the viem .call() function so you don't mix and match provider libraries (since you're using viem's encodeFunctionData fn already):

https://viem.sh/docs/actions/public/call.html

id: "C001",
title: "Verify MOON-2824",
test: async function () {
if (paraApi.consts.system.version.specName.toString() !== "moonriver") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for all moonbeam runtimes or for only the Moonbeam network?

If the former then you can use: chainType: "moonbeam", on the test case. If the latter then it's api.rpc.system.chain()

Copy link
Contributor

Coverage Report

@@                 Coverage Diff                 @@
##           master   rq/smoking-tests     +/-   ##
===================================================
  Coverage   73.06%             73.06%   0.00%     
  Files         228                228             
  Lines       69944              69944             
===================================================
  Hits        51103              51103             
  Misses      18841              18841             
Files Changed Coverage

Coverage generated Wed Apr 24 16:35:56 UTC 2024

@RomarQ
Copy link
Contributor Author

RomarQ commented Jul 2, 2024

Also add a regression test for MOON-2702.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B0-silent Changes should not be mentioned in any release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants