Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce refund logic for ibc transfer if tx failed by timeout. #498

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

RustNinja
Copy link
Collaborator

introduce refund logic for ibc transfer if tx failed by timeout.

@@ -378,13 +381,21 @@ func NewSimApp(

app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())
app.IbcTransferMiddlewareKeeper = ibctransfermiddleware.NewKeeper(appCodec, keys[ibctransfermiddlewaretypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String(),
[]string{

Choose a reason for hiding this comment

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

what's this?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is for setting fees. this is for testnet

Choose a reason for hiding this comment

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

so it's an unrelated change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this needed to make tests build success.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we introduce keeper to ibc hook
so we need to pass it now in tests.
this i why i added a IbcTransferMiddlewareKeeper to pass into ibc hook

@@ -17,24 +17,24 @@ DENOM=${2:-ppica}
# remove existing daemon
rm -rf ~/.banksy*

centaurid config keyring-backend $KEYRING
centaurid config chain-id $CHAINID
picad config keyring-backend $KEYRING

Choose a reason for hiding this comment

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

why change this?

Copy link
Contributor

Choose a reason for hiding this comment

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

prefix change


// calculate the percentage charge
/*
coin.Percentage is 100 that means that we charge 1/100 of the transfer amount

Choose a reason for hiding this comment

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

do we charge 1%? Where does this number come from?

Copy link
Collaborator Author

@RustNinja RustNinja Apr 24, 2024

Choose a reason for hiding this comment

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

it is example.
we charge depends on config.
I described how it calculates.
To find a percentage fee from a new amount

@kkast kkast merged commit b67db99 into develop2 Apr 24, 2024
10 of 13 checks passed
@kkast kkast deleted the rustdev/cosmos-ibc-fee-timeout-refund branch April 24, 2024 16:18
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.

3 participants