mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
add state to swap genesis (#997)
This commit is contained in:
parent
cd2827dbe7
commit
1a90c3bec6
@ -336,6 +336,16 @@ func loadStabilityComMembers() ([]sdk.AccAddress, error) {
|
||||
|
||||
// Swap introduces new v0.15 swap genesis state
|
||||
func Swap() v0_15swap.GenesisState {
|
||||
// TODO add swap genesis state
|
||||
return v0_15swap.DefaultGenesisState()
|
||||
pools := v0_15swap.AllowedPools{
|
||||
v0_15swap.NewAllowedPool("bnb", "usdx"),
|
||||
v0_15swap.NewAllowedPool("btcb", "usdx"),
|
||||
v0_15swap.NewAllowedPool("busd", "usdx"),
|
||||
v0_15swap.NewAllowedPool("hard", "usdx"),
|
||||
v0_15swap.NewAllowedPool("swp", "usdx"),
|
||||
v0_15swap.NewAllowedPool("ukava", "usdx"),
|
||||
v0_15swap.NewAllowedPool("usdx", "xrpb"),
|
||||
}
|
||||
fee := sdk.MustNewDecFromStr("0.0015")
|
||||
params := v0_15swap.NewParams(pools, fee)
|
||||
return v0_15swap.NewGenesisState(params, v0_15swap.DefaultPoolRecords, v0_15swap.DefaultShareRecords)
|
||||
}
|
||||
|
@ -104,6 +104,15 @@ func TestIncentive(t *testing.T) {
|
||||
require.JSONEq(t, string(bz), string(appState[v0_15incentive.ModuleName]))
|
||||
}
|
||||
|
||||
func TestSwap(t *testing.T) {
|
||||
swapGS := Swap()
|
||||
err := swapGS.Validate()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 7, len(swapGS.Params.AllowedPools))
|
||||
require.Equal(t, 0, len(swapGS.PoolRecords))
|
||||
require.Equal(t, 0, len(swapGS.ShareRecords))
|
||||
}
|
||||
|
||||
// Compare migration against auto-generated snapshot to catch regressions
|
||||
func TestAuth_Snapshot(t *testing.T) {
|
||||
bz, err := ioutil.ReadFile(filepath.Join("testdata", "kava-7-test-auth-state.json"))
|
||||
|
Loading…
Reference in New Issue
Block a user