Skip to content

Commit

Permalink
fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason committed Aug 30, 2023
1 parent 02d4e51 commit 7950fef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions tests/e2e/src/create_test_data/createTestDataManage.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const createTestDataMange = {
fs.mkdirSync(`${basePath}/`);
}
},

async sendRawTestTx() {
const toAddress = Config.getIns().acount2;
const nonce = (await web3.eth.getTransactionCount(accountFrom.address)) + 1;
Expand All @@ -133,10 +134,12 @@ const createTestDataMange = {
const privateKey = Buffer.from(Config.getIns().hexPrivateKey.substring(2), 'hex');
const signedTx = tx.sign(privateKey);
const serializedTx = signedTx.serialize();
return serializedTx.toString("hex");
const prefix = "0x";
return prefix + serializedTx.toString("hex");
},

async sendPreEip155RawTestTx() {
const toAddress = Config.getIns().acount2;
const toAddress = Config.getIns().aount2;
const nonce = (await web3.eth.getTransactionCount(accountFrom.address)) + 1;
const txObject = {
nonce: web3.utils.toHex(nonce),
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/src/web3_sha3.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("web3_sha3", () => {
const param1 = await page.$(goto.pageIds.param1Id);
await testType.type("1"); // 0: none params 1: common params to request 2: more params
await param1.type("");
await goto.check(page, "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");
await goto.check(page, "-32603");
});

/**
Expand Down Expand Up @@ -56,7 +56,7 @@ describe("web3_sha3", () => {
await testType.type("1");
const param1 = await page.$(goto.pageIds.param1Id);
await param1.type("123456");
await goto.check(page, "0x6adf031833174bbe4c85eafe59ddb54e6584648c2c962c6f94791ab49caa0ad4");
await goto.check(page, "-32603");
});

/**
Expand All @@ -67,7 +67,7 @@ describe("web3_sha3", () => {
await testType.type("1");
const param1 = await page.$(goto.pageIds.param1Id);
await param1.type("68656c6c6f20776f726c64");
await goto.check(page, "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad");
await goto.check(page, "-32603");
});

/**
Expand Down

0 comments on commit 7950fef

Please sign in to comment.