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

chore: rename instances of "delta" to "deltas" #738

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Jun1on
Copy link
Contributor

@Jun1on Jun1on commented Jun 4, 2024

Related Issue

BalanceDelta and BeforeSwapDelta are custom types of 2 int128s packed into a single 32 byte slot. However, other contexts like CurrencyDelta refer to a single value.

This singular naming scheme is confusing.

Description of changes

Rename BalanceDelta, BeforeSwapDelta, and other "delta" namings to plural form.
Rename hook flags to "ReturnDeltas" except for afterSwap (which only returns one delta).

@nishim3
Copy link
Contributor

nishim3 commented Jun 6, 2024

Just renaming the variables generally does not cause such a large gas difference

@Jun1on
Copy link
Contributor Author

Jun1on commented Jun 10, 2024

these gas snapshots changed regardless of the name change (just cloning main and running forge test)

@nishim3
Copy link
Contributor

nishim3 commented Jun 10, 2024

these gas snapshots changed regardless of the name change (just cloning main and running forge test)

Do you run using --isolate?

@Jun1on
Copy link
Contributor Author

Jun1on commented Jun 10, 2024

ah ok got it thanks

src/interfaces/IHooks.sol Outdated Show resolved Hide resolved
src/interfaces/IHooks.sol Outdated Show resolved Hide resolved
src/interfaces/IPoolManager.sol Outdated Show resolved Hide resolved
src/libraries/Hooks.sol Outdated Show resolved Hide resolved
src/libraries/Hooks.sol Outdated Show resolved Hide resolved
src/test/EmptyRevertHook.sol Outdated Show resolved Hide resolved
src/test/EmptyRevertHook.sol Outdated Show resolved Hide resolved
src/test/EmptyRevertHook.sol Outdated Show resolved Hide resolved
test/types/BalanceDeltas.t.sol Show resolved Hide resolved
src/types/BeforeSwapDeltas.sol Show resolved Hide resolved
@Jun1on Jun1on changed the title Rename Instances of "Delta" to "Deltas" chore: rename instances of "delta" to "deltas" Jun 11, 2024
snreynolds

This comment was marked as resolved.

snreynolds
snreynolds previously approved these changes Jun 17, 2024
@snreynolds snreynolds self-requested a review June 18, 2024 15:36
Copy link
Member

@snreynolds snreynolds left a comment

Choose a reason for hiding this comment

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

tests failing, need to fix imports

@snreynolds snreynolds self-requested a review June 18, 2024 17:01
Copy link
Member

@snreynolds snreynolds left a comment

Choose a reason for hiding this comment

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

CI still broken! gotta lint

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