Skip to content

Commit

Permalink
fix (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal authored Apr 1, 2024
1 parent a99aece commit 13b3d95
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const couldNotFoundBlockFormat = "could not find block. Number: %d, Hash: %s"

// DefaultGasHelperConfig is the default config for gas helper (as per ethereum)
var DefaultGasHelperConfig = &Config{
NumOfBlocksToCheck: 20,
NumOfBlocksToCheck: 5,
PricePercentile: 60,
SampleNumber: 3,
MaxPrice: ethgo.Gwei(500),
Expand Down
6 changes: 4 additions & 2 deletions loadtest/scenarios/multiple_EOA.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ export async function setup() {
mnemonic: mnemonic,
});

var gas_price = client.gasPrice();

var accounts = await fundTestAccounts(client, root_address);

return { accounts: accounts };
return { accounts: accounts, gas_price: gas_price };
}

var clients = [];
Expand All @@ -85,7 +87,7 @@ export default function (data) {
const tx = {
to: "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF",
value: Number(0.00000001 * 1e18),
gas_price: client.gasPrice()*1.2,
gas_price: data.gas_price*1.3,
nonce: userData.nonce,
};

Expand Down
7 changes: 5 additions & 2 deletions loadtest/scenarios/multiple_ERC20.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ export async function setup() {

const receipt = client.deployContract(JSON.stringify(ZexCoin.abi), ZexCoin.bytecode.substring(2), 500000000000, "ZexCoin", "ZEX")

var gas_price = client.gasPrice();

var accounts = await fundTestAccounts(client, root_address);

return {
accounts: accounts,
contract_address: data.contract_address
contract_address: data.contract_address,
gas_price: gas_price
};
}

Expand All @@ -93,7 +96,7 @@ export default function (data) {

console.log(acc.address);
const con = client.newContract(data.contract_address, JSON.stringify(ZexCoin.abi));
const res = con.txn("transfer", { gas_limit: 100000, nonce: acc.nonce, gas_price: client.gasPrice()*1.3 }, acc.address, 1);
const res = con.txn("transfer", { gas_limit: 100000, nonce: acc.nonce, gas_price: data.gas_price*1.3 }, acc.address, 1);
console.log("sender => " + acc.address + " tx hash => " + res + " nonce => " + acc.nonce);

acc.nonce++;
Expand Down

0 comments on commit 13b3d95

Please sign in to comment.