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

Rename Record to PoolAsset #75

Merged
merged 7 commits into from
Apr 7, 2021
Merged

Rename Record to PoolAsset #75

merged 7 commits into from
Apr 7, 2021

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Apr 6, 2021

closes #70

We should in a follow-on PR start working on documenting this module generally.

Question, should this be PoolReserves instead of PoolAsset?

@ValarDragon ValarDragon changed the title Rename Record to PoolAsset Rename Record to PoolAsset - WIP Apr 6, 2021
@ValarDragon ValarDragon marked this pull request as draft April 6, 2021 18:43
x/gamm/keeper/multihop.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
x/gamm/types/account.go Outdated Show resolved Hide resolved
@ValarDragon
Copy link
Member Author

The last two commits fixes a small amount of typos, error messages & panic messages. I think they're pretty minor, so not separating them into a standalone PR.

SetPoolAsset(denom string, PoolAsset PoolAsset) error
GetPoolAssets(denoms ...string) ([]PoolAsset, error)
SetPoolAssets(PoolAsset []PoolAsset) error
GetAllPoolAssets() []PoolAsset
Copy link
Member Author

Choose a reason for hiding this comment

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

I do wonder if we should rename these methods to remove the Pool prefix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically PoolAsset includes the weight, and is a bit different from the typical notion of 'assets' so do we really need to change it? But then again, I'm going to assume whoever is looking at the code would know it. So I'm fine either way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, sounds good. I do think theres probably a better name than PoolAsset as well, since it also includes the weight, but I think this name is significantly more descriptive

@ValarDragon ValarDragon requested review from Thunnini and sunnya97 April 6, 2021 19:29
@ValarDragon ValarDragon changed the title Rename Record to PoolAsset - WIP Rename Record to PoolAsset Apr 6, 2021
@ValarDragon ValarDragon marked this pull request as ready for review April 6, 2021 19:30
@sunnya97
Copy link
Collaborator

sunnya97 commented Apr 6, 2021

Should we maybe call this "WeightedAmmAsset"? Eventually, the assets in a pool will be different than the assets in the amm (new pool types might keep some things in reserve, but not in the amm itself. For example, the Balancer v2 asset managers)

@ValarDragon
Copy link
Member Author

new pool types might keep some things in reserve

But this logic is explicitly only for Balancer v1 pools. Perhaps AmmAsset suffices?

@ValarDragon ValarDragon merged commit 83ba2fd into main Apr 7, 2021
@ValarDragon ValarDragon deleted the rename_record branch April 7, 2021 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Rename Record to PoolAssetType
3 participants