Skip to content

Commit fe9f811

Browse files
authored
Reconciliation contract: Full state instantiation (#365)
1 parent f6f9920 commit fe9f811

File tree

4 files changed

+259
-62
lines changed

4 files changed

+259
-62
lines changed

cmd/fetchd/cmd/gen_asi_upgrade_manifest.go

Lines changed: 57 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,64 @@ import (
99
"path"
1010
)
1111

12-
type ASIUpgradeTransfer struct {
13-
From string `json:"from"`
14-
Amount types.Coins `json:"amount"`
12+
type ASIUpgradeIBCTransfer struct {
13+
From string `json:"from"`
14+
ChannelID string `json:"channel_id"`
15+
Amount types.Coins `json:"amount"`
1516
}
1617

17-
type ASIUpgradeTransfers struct {
18-
Transfer []ASIUpgradeTransfer `json:"transfer"`
19-
To string `json:"to"`
18+
type ASIUpgradeIBCTransfers struct {
19+
Transfers []ASIUpgradeIBCTransfer `json:"transfer"`
20+
To string `json:"to"`
21+
AggregatedTransferredAmount types.Coins `json:"aggregated_transferred_amount"`
22+
NumberOfTransfers int `json:"number_of_transfers"`
23+
}
24+
25+
type ASIUpgradeReconciliationTransfer struct {
26+
From string `json:"from"`
27+
EthAddr string `json:"eth_addr"`
28+
Amount types.Coins `json:"amount"`
29+
}
30+
31+
type ASIUpgradeReconciliationTransfers struct {
32+
Transfers []ASIUpgradeReconciliationTransfer `json:"transfers"`
33+
To string `json:"to"`
34+
AggregatedTransferredAmount types.Coins `json:"aggregated_transferred_amount"`
35+
NumberOfTransfers int `json:"number_of_transfers"`
36+
}
37+
38+
type ASIUpgradeReconciliationContractStateBalanceRecord struct {
39+
EthAddr string `json:"eth_addr"`
40+
Balances types.Coins `json:"balances"`
41+
}
42+
43+
type ASIUpgradeReconciliationContractState struct {
44+
Balances []ASIUpgradeReconciliationContractStateBalanceRecord `json:"balances"`
45+
AggregatedBalancesAmount types.Coins `json:"aggregated_balances_amount"`
46+
NumberOfBalanceRecords int `json:"number_of_balance_records"`
47+
}
48+
49+
func NewASIUpgradeReconciliationContractState() *ASIUpgradeReconciliationContractState {
50+
return &ASIUpgradeReconciliationContractState{
51+
Balances: make([]ASIUpgradeReconciliationContractStateBalanceRecord, 0),
52+
}
53+
}
54+
55+
type ASIUpgradeReconciliation struct {
56+
Transfers ASIUpgradeReconciliationTransfers `json:"transfers"`
57+
ContractState *ASIUpgradeReconciliationContractState `json:"contract_state"`
2058
}
2159

2260
type ASIUpgradeSupply struct {
2361
LandingAddress string `json:"landing_address"`
2462
MintedAmount types.Coins `json:"minted_amount"`
25-
ResultingSupplyTotal types.Coins `json:"resulting_supply_total"`
63+
ResultingTotalSupply types.Coins `json:"resulting_total_supply"`
64+
}
65+
66+
type ContractValueUpdate struct {
67+
Address string `json:"address"`
68+
From string `json:"from"`
69+
To string `json:"to"`
2670
}
2771

2872
type ValueUpdate struct {
@@ -38,9 +82,12 @@ type MainParams struct {
3882
}
3983

4084
type ASIUpgradeManifest struct {
41-
Main *MainParams `json:"main,omitempty"`
42-
IBC *ASIUpgradeTransfers `json:"ibc,omitempty"`
43-
Reconciliation *ASIUpgradeTransfers `json:"reconciliation,omitempty"`
85+
Main *MainParams `json:"main,omitempty"`
86+
IBC *ASIUpgradeIBCTransfers `json:"ibc,omitempty"`
87+
Reconciliation *ASIUpgradeReconciliation `json:"reconciliation,omitempty"`
88+
ContractsStateCleaned []string `json:"contracts_state_cleaned,omitempty"`
89+
ContractsAdminUpdated []ContractValueUpdate `json:"contracts_admin_updated,omitempty"`
90+
ContractsLabelUpdated []ContractValueUpdate `json:"contracts_label_updated,omitempty"`
4491
}
4592

4693
func SaveASIManifest(manifest *ASIUpgradeManifest, config *config2.Config) error {

0 commit comments

Comments
 (0)