Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

fix: middleware panic upon receiving amount that is not int64 #78

Merged
merged 1 commit into from
May 19, 2023
Merged

fix: middleware panic upon receiving amount that is not int64 #78

merged 1 commit into from
May 19, 2023

Conversation

xlab
Copy link
Contributor

@xlab xlab commented May 8, 2023

Added a check that doesn't attempt to do SetGaugeWithLabels if amount is not convertible to Int64. Doesn't raise a panic in case when uint256 numbers used for amount.

Added a new unit test:

--- FAIL: TestOnRecvPacket_ForwardAmountInt256 (0.00s)
panic: Int64() out of bound [recovered]
	panic: Int64() out of bound [recovered]
	panic: Int64() out of bound

Resolves #77

Copy link
Member

@agouin agouin left a comment

Choose a reason for hiding this comment

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

Thank you for this fix!

@agouin agouin merged commit 0716548 into strangelove-ventures:main May 19, 2023
@xlab xlab deleted the f/fix-uint256-overflow branch May 21, 2023 15:21
boojamya pushed a commit that referenced this pull request May 23, 2023
boojamya pushed a commit that referenced this pull request May 23, 2023
boojamya pushed a commit that referenced this pull request May 23, 2023
boojamya pushed a commit that referenced this pull request May 23, 2023
boojamya pushed a commit that referenced this pull request May 23, 2023
jackzampolin pushed a commit that referenced this pull request May 23, 2023
* Fix same bool being used for all 3 (#81)

* fix: middleware panic upon receiving amount that is not int64; added test (#78)

resolves #77

* fix test

* remove unused make command

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Max Kupriianov <max@kc.vc>
jackzampolin pushed a commit that referenced this pull request May 23, 2023
* Fix same bool being used for all 3 (#81)

* fix: middleware panic upon receiving amount that is not int64; added test (#78)

resolves #77

* Fix: Allows timeout field to accept both uint64 and string durations (#80)

* timeout accetps both string and time.duration

* feedback

* handle invalid unmarshalls

* Update router/ibc_middleware.go

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* add test case for empty valid json

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* fix tests

* remove unused protos

* regen-protos

* fix lint

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Max Kupriianov <max@kc.vc>
jackzampolin pushed a commit that referenced this pull request May 23, 2023
* Fix same bool being used for all 3 (#81)

* fix: middleware panic upon receiving amount that is not int64; added test (#78)

resolves #77

* Fix: Allows timeout field to accept both uint64 and string durations (#80)

* timeout accetps both string and time.duration

* feedback

* handle invalid unmarshalls

* Update router/ibc_middleware.go

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* add test case for empty valid json

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* fix for ibc-go version

* re gen protos

* remove unused make test command

* fix lint

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Max Kupriianov <max@kc.vc>
jackzampolin pushed a commit that referenced this pull request May 23, 2023
* Fix same bool being used for all 3 (#81)

* fix: middleware panic upon receiving amount that is not int64; added test (#78)

resolves #77

* Fix: Allows timeout field to accept both uint64 and string durations (#80)

* timeout accetps both string and time.duration

* feedback

* handle invalid unmarshalls

* Update router/ibc_middleware.go

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* add test case for empty valid json

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>

* make compliant with ibc-go version and fix lint

* remove unused make test command

* regen protos

* add lint check to CI

---------

Co-authored-by: Andrew Gouin <andrew@gouin.io>
Co-authored-by: Max Kupriianov <max@kc.vc>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Middleware panics when transferring tokens with 10^18 denom
3 participants