Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
luu-alex committed Oct 25, 2023
1 parent 62ed18d commit a9b0f30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
14 changes: 7 additions & 7 deletions packages/web3/test/integration/web3config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('Web3 instance', () => {
});

it('should be send transaction, change for defaultTransactionType and sucesfully send transaction with different type', async () => {
let transaction = {
const transaction = {
from: accounts[0],
to: accounts[0],
value: 100000,
Expand All @@ -80,7 +80,7 @@ describe('Web3 instance', () => {
});

it('defaultChain should be send transaction, change for defaultTransactionType and sucesfully send transaction with different type', async () => {
let transaction = {
const transaction = {
from: accounts[0],
to: accounts[0],
value: 100000,
Expand All @@ -96,19 +96,19 @@ describe('Web3 instance', () => {
});

it('create contract and change contract data to input', async () => {
const web3 = new Web3(provider);
let transaction = {
const web = new Web3(provider);
const transaction = {
from: accounts[0],
to: accounts[0],
value: 100000,
}

const receipt = await web3.eth.sendTransaction(transaction);
const receipt = await web.eth.sendTransaction(transaction);
expect(receipt.type).toEqual(BigInt(2))

web3.setConfig({defaultTransactionType: "0x0"});
web.setConfig({defaultTransactionType: "0x0"});

const receipt2 = await web3.eth.sendTransaction(transaction);
const receipt2 = await web.eth.sendTransaction(transaction);
expect(receipt2.type).toEqual(BigInt(0))
});

Expand Down
15 changes: 6 additions & 9 deletions packages/web3/test/unit/web3Config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ describe('web3config web3 tests', () => {
expect(web3.config.defaultTransactionType).toBe("0x0");
});

it.only('should be able to create web3 and setconfig ', async () => {
it('should be able to create web3 and setconfig', async () => {
const web3 = new Web3("");
web3.setConfig({defaultTransactionType: "0x0"});
expect(web3.config.defaultTransactionType).toBe("0x0");
expect(web3.getContextObject().config.defaultTransactionType).toBe("0x0");

expect(web3.eth.config.defaultTransactionType).toBe("0x0");
expect(web3.eth.getContextObject().config.defaultTransactionType).toBe("0x0");
// expect(web3.eth.config.defaultTransactionType).toBe("0x0");
// expect(web3.eth.getContextObject().config.defaultTransactionType).toBe("0x0");

web3.setConfig({contractDataInputFill:"both"});
const contract = new web3.eth.Contract([]);
Expand All @@ -60,7 +60,7 @@ describe('web3config web3 tests', () => {

const c1 = new web3.eth.Contract([], '')
// console.log(c1.config.contractDataInputFill) // input
expect(c1.config.contractDataInputFill).toEqual("input")
expect(c1.config.contractDataInputFill).toBe("input")
// const web3ProviderBase = new Web3ProviderBase(providerOptions)
// expect(web3ProviderBase).toMatchObject({
// _providerUrl: providerOptions.providerUrl
Expand All @@ -69,14 +69,11 @@ describe('web3config web3 tests', () => {
});

it('contractDataInputFill', () => {
console.log("creating web3")
const web3 = new Web3('http://127.0.0.1:8545');
console.log("set config")
web3.setConfig({ contractDataInputFill: "data" });
console.log("set")
const c1 = new web3.eth.Contract([], '')
// console.log(c1.config.contractDataInputFill) // input
expect(c1.config.contractDataInputFill).toEqual("data")
expect(c1.config.contractDataInputFill).toBe("data")
// const web3ProviderBase = new Web3ProviderBase(providerOptions)
// expect(web3ProviderBase).toMatchObject({
// _providerUrl: providerOptions.providerUrl
Expand All @@ -89,7 +86,7 @@ describe('web3config web3 tests', () => {

const c1 = new web3.eth.Contract([], '')
// console.log(c1.config.contractDataInputFill) // input
expect(c1.config.contractDataInputFill).toEqual("data")
expect(c1.config.contractDataInputFill).toBe("data")
// const web3ProviderBase = new Web3ProviderBase(providerOptions)
// expect(web3ProviderBase).toMatchObject({
// _providerUrl: providerOptions.providerUrl
Expand Down

0 comments on commit a9b0f30

Please sign in to comment.