Skip to content

Commit

Permalink
Merge pull request #105 from hadronlabs-org/feat/update-gas-params
Browse files Browse the repository at this point in the history
DRP-208: Feat/update gas params
  • Loading branch information
faust403 authored Jul 1, 2024
2 parents 0955805 + a76f3d0 commit cf412a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion scripts/generate_activity_script/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ TARGET_DENOM = stake
# IBC channel to send from neutron to remote chain
IBC_CHANNEL_TO = channel-1003
# IBC channel to send from remote chain to neutron
IBC_CHANNEL_FROM = channel-11
IBC_CHANNEL_FROM = channel-11

# Gas price on Neutron chain (by default it's 0.05)
NEUTRON_GASPRICE = 0.05
# Gas price on target chain (by default it's 0.05, but you can easily change it here)
TARGET_GASPRICE = 0.05
2 changes: 2 additions & 0 deletions scripts/generate_activity_script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ To manage script config, open _.env_ file
- TARGET_DENOM = Base denom on remote chain
- IBC_CHANNEL_TO = IBC channel to send from neutron to remote chain
- IBC_CHANNEL_FROM = IBC channel to send from remote chain to neutron
- NEUTRON_GASPRICE = Gas price on Neutron chain
- TARGET_GASPRICE = Gas price on target chain
11 changes: 7 additions & 4 deletions scripts/generate_activity_script/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const UNBOND_PROB: number = parseFloat(process.env.UNBOND_PROB) || 0;
const WITHDRAW_PROB: number = parseFloat(process.env.WITHDRAW_PROB) || 0;
const PROCESS_LSM_PROB: number = parseFloat(process.env.PROCESS_LSM_PROB) || 0;

const TARGET_GASPRICE: number = parseFloat(process.env.TARGET_GASPRICE);
const NEUTRON_GASPRICE: number = parseFloat(process.env.NEUTRON_GASPRICE);

/*
* Each of given probabilities should be in interval [0, 1]
* According to given probabilities relevant actions will be choosed with appropriate probability
Expand Down Expand Up @@ -829,7 +832,7 @@ async function main() {
NEUTRON_NODE_ADDRESS,
neutronWallet.mainWallet,
{
gasPrice: GasPrice.fromString("0.75untrn"),
gasPrice: GasPrice.fromString(`${NEUTRON_GASPRICE}untrn`),
}
);
neutronWallet.clientSG = await SigningStargateClient.connectWithSigner(
Expand All @@ -844,7 +847,7 @@ async function main() {
["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer],
])
),
gasPrice: GasPrice.fromString("0.75untrn"),
gasPrice: GasPrice.fromString(`${NEUTRON_GASPRICE}untrn`),
}
);
neutronWallet.mainAccounts = await neutronWallet.mainWallet.getAccounts();
Expand All @@ -860,7 +863,7 @@ async function main() {
TARGET_NODE_ADDRESS,
targetWallet.mainWallet,
{
gasPrice: GasPrice.fromString(`0.75${TARGET_DENOM}`),
gasPrice: GasPrice.fromString(`${TARGET_GASPRICE}${TARGET_DENOM}`),
}
);
targetWallet.clientSG = await SigningStargateClient.connectWithSigner(
Expand All @@ -881,7 +884,7 @@ async function main() {
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
])
),
gasPrice: GasPrice.fromString(`0.75${TARGET_DENOM}`),
gasPrice: GasPrice.fromString(`${TARGET_GASPRICE}${TARGET_DENOM}`),
}
);
targetWallet.mainAccounts = await targetWallet.mainWallet.getAccounts();
Expand Down

0 comments on commit cf412a8

Please sign in to comment.