-
Notifications
You must be signed in to change notification settings - Fork 12
Throw away codechain-sdk dependency on foundry tests. #189
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
Conversation
In this patch, functions that previously worked with sdk.rpc are replaced by foundry-rpc
In this patch, functions that previously worked with sdk.rpc are replaced by foundry-rpc
In previous commits, we removed stakholder dependecies on sdk.rpc. Now we adapt tests that use sdk.rpc for their tests.
09058bd to
b15c349
Compare
test/src/e2e/changeParams.test.ts
Outdated
|
|
||
| await expect(node.sendPayTx({ fee: 10 })).rejectedWith(/Too Low Fee/); | ||
| try { | ||
| await expect(node.sendPayTx({ fee: 10 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add expect.fail(); here.
test/src/e2e/changeParams.test.ts
Outdated
| ).be.true; | ||
| await expect(node.sendPayTx({ fee: 4 })).rejectedWith(/Too Low Fee/); | ||
| try { | ||
| await expect(node.sendPayTx({ fee: 4 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
test/src/e2e/changeParams.test.ts
Outdated
| ).not.be.null; | ||
| } | ||
| try { | ||
| await expect(node.sendPayTx({ fee: 10 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
test/src/e2e/changeParams.test.ts
Outdated
| /Too Low Fee/ | ||
| ); | ||
| try { | ||
| await expect(node.sendPayTx({ fee: 10 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
test/src/e2e/customAction.test.ts
Outdated
| await node.rpc.engine.getCustomActionData({ | ||
| handlerId: hitActionHandlerId, | ||
| bytes: `0x${hitcount}`, | ||
| bytes: `0xca${hitcount}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use a magic string (0xca) here.
test/src/e2e/network2.test.ts
Outdated
| ) { | ||
| await wait(500); | ||
| } | ||
| console.log("I am here"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line.
test/src/e2e/network2.test.ts
Outdated
| expect( | ||
| await nodeB.testFramework.rpc.network.getPeers() | ||
| ).to.deep.equal([`${address}:${nodeA.port}`]); | ||
| // console.log(await nodeA.rpc.net.getEstablishedPeers()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line.
Previously, there were some sdk functions that were not replaced. In this commit, all of them remove and e2e tests rely on foundry rpc completely
The removed rpc was the rpc that is being used in codechian-sdk. We replace it with foundry-rpc-js
Previously, we add some setting in order to exclude sdk and stakeholder when we run yarn fmt. Now, settings are backed to their normal state
Due to previous settings, these files were not include in yarn lint and yarn fmt
In this patch and previous patch, we aimed to remove
codechain-sdkdependency and replace tests with foundry-rpc. This patch is the final stage of this work and is designed to removecodechain-sdkdependency on bothstakeholderfunctions ande2e.dynvaltests and eventually get rid ofsdk.rpc. It fixes #107.