Skip to content

Conversation

@MSNTCS
Copy link
Contributor

@MSNTCS MSNTCS commented Feb 20, 2020

In this patch and previous patch, we aimed to remove codechain-sdk dependency and replace tests with foundry-rpc. This patch is the final stage of this work and is designed to remove codechain-sdk dependency on both stakeholder functions and e2e.dynval tests and eventually get rid of sdk.rpc. It fixes #107.

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.
@MSNTCS MSNTCS force-pushed the master branch 3 times, most recently from 09058bd to b15c349 Compare February 21, 2020 07:19
@MSNTCS MSNTCS requested a review from majecty February 21, 2020 08:41
@MSNTCS MSNTCS changed the title [WIP] Throw away codechain-sdk dependency on foundry tests. Throw away codechain-sdk dependency on foundry tests. Feb 21, 2020

await expect(node.sendPayTx({ fee: 10 })).rejectedWith(/Too Low Fee/);
try {
await expect(node.sendPayTx({ fee: 10 }));
Copy link
Contributor

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.

).be.true;
await expect(node.sendPayTx({ fee: 4 })).rejectedWith(/Too Low Fee/);
try {
await expect(node.sendPayTx({ fee: 4 }));
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

).not.be.null;
}
try {
await expect(node.sendPayTx({ fee: 10 }));
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

/Too Low Fee/
);
try {
await expect(node.sendPayTx({ fee: 10 }));
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

await node.rpc.engine.getCustomActionData({
handlerId: hitActionHandlerId,
bytes: `0x${hitcount}`,
bytes: `0xca${hitcount}`,
Copy link
Contributor

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.

) {
await wait(500);
}
console.log("I am here");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this line.

expect(
await nodeB.testFramework.rpc.network.getPeers()
).to.deep.equal([`${address}:${nodeA.port}`]);
// console.log(await nodeA.rpc.net.getEstablishedPeers());
Copy link
Contributor

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
@sgkim126 sgkim126 merged commit 21e06f4 into CodeChain-io:master Feb 22, 2020
@MSNTCS MSNTCS mentioned this pull request Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Foundry RPC

3 participants