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

feat: ASI manifest #353

Merged
merged 5 commits into from
May 22, 2024
Merged

feat: ASI manifest #353

merged 5 commits into from
May 22, 2024

Conversation

Jonathansumner
Copy link
Member

No description provided.

@Jonathansumner Jonathansumner requested a review from pbukva May 20, 2024 11:07
@Jonathansumner Jonathansumner self-assigned this May 20, 2024
Comment on lines 24 to 25
Amount types.Coins `json:"amount"`
NewSupplyTotal types.Coins `json:"new_supply_total"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest to rename data members:

Suggested change
Amount types.Coins `json:"amount"`
NewSupplyTotal types.Coins `json:"new_supply_total"`
MintedAmount types.Coins `json:"minted_amount"`
ResultingSupplyTotal types.Coins `json:"resulting_supply_total"`

type ASIUpgradeManifest struct {
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"`
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"`
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. I'm not quite sure why is this an array. This can be simply directly value type, or pointer to type.
    • In the example below I used the pointer to type in order to have additional degree of freedom - to enable complete exclusion of the Supply data member from json completelly, if really required. Though honestly, it is not required - it can be directly value type ASIUpgradeSupplyMint, since its Coins data members are arrays themselves.
  2. I would rename this data member to simply Supply:
Suggested change
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"`
SupplyMint *ASIUpgradeSupplyMint `json:"supply_mint"`

Amount: sdk.NewCoins(additionalSupplyCoin),
NewSupplyTotal: sdk.NewCoins(newSupplyCoins),
}
manifest.SupplyMint = append(manifest.SupplyMint, mintRecord)
Copy link
Collaborator

Choose a reason for hiding this comment

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

As per my inline comments above:

Suggested change
manifest.SupplyMint = append(manifest.SupplyMint, mintRecord)
manifest.Supply = supplyRecord

@@ -496,6 +496,14 @@ func ASIGenesisUpgradeASISupply(jsonData map[string]interface{}, networkInfo Net
// add the additional coins to the overflow address balance
overflowAddressBalanceCoins = overflowAddressBalanceCoins.Add(additionalSupplyCoin)

// add the new supply mint record to the manifest
mintRecord := ASIUpgradeSupplyMint{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit pick - feel free to ignore.

Suggested change
mintRecord := ASIUpgradeSupplyMint{
supplyRecord := ASIUpgradeSupplyMint{

Comment on lines 29 to 31
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"`
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"`
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"`
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"`
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"`
Supply *ASIUpgradeSupply `json:"supply,omitempty"`
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"`
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"`

Copy link
Collaborator

@pbukva pbukva left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@pbukva pbukva left a comment

Choose a reason for hiding this comment

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

LGTM

@Jonathansumner Jonathansumner merged commit 3e6b6a7 into feat/aasi-merger-cmd May 22, 2024
1 check passed
@Jonathansumner Jonathansumner deleted the feat/asi-manifest branch May 22, 2024 17:09
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.

2 participants