-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: ASI manifest #353
Conversation
Amount types.Coins `json:"amount"` | ||
NewSupplyTotal types.Coins `json:"new_supply_total"` |
There was a problem hiding this comment.
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:
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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 itsCoins
data members are arrays themselves.
- 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
- I would rename this data member to simply
Supply
:
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"` | |
SupplyMint *ASIUpgradeSupplyMint `json:"supply_mint"` |
Amount: sdk.NewCoins(additionalSupplyCoin), | ||
NewSupplyTotal: sdk.NewCoins(newSupplyCoins), | ||
} | ||
manifest.SupplyMint = append(manifest.SupplyMint, mintRecord) |
There was a problem hiding this comment.
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:
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{ |
There was a problem hiding this comment.
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.
mintRecord := ASIUpgradeSupplyMint{ | |
supplyRecord := ASIUpgradeSupplyMint{ |
SupplyMint []ASIUpgradeSupplyMint `json:"supply_mint"` | ||
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"` | ||
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.