MCPcopy Create free account
hub / github.com/Sifchain/sifnode / TC2

Function TC2

integrationtest/integration_test.go:113–217  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TC2(t *testing.T) TestCase {
114 sifapp.SetConfig(false)
115 externalAsset := "cusdc"
116 address := "sif1syavy2npfyt9tcncdtsdzf7kny9lh777yqc2nd"
117 addresses, _ := ethtest.CreateTestAddrs(1)
118
119 externalAssetBalance, ok := sdk.NewIntFromString("1000000000000000000") // 1,000,000,000,000.000000
120 require.True(t, ok)
121 nativeAssetBalance, ok := sdk.NewIntFromString("1000000000000000000000000000000") // 1000,000,000,000.000000000000000000
122 require.True(t, ok)
123 balances := []banktypes.Balance{
124 {
125 Address: address,
126 Coins: sdk.Coins{
127 sdk.NewCoin("atom", externalAssetBalance),
128 sdk.NewCoin(externalAsset, externalAssetBalance),
129 sdk.NewCoin("rowan", nativeAssetBalance),
130 },
131 },
132 {
133 Address: addresses[0].String(),
134 Coins: sdk.Coins{
135 sdk.NewCoin("atom", externalAssetBalance),
136 sdk.NewCoin(externalAsset, externalAssetBalance),
137 sdk.NewCoin("rowan", nativeAssetBalance),
138 },
139 },
140 }
141 allocation := sdk.NewUintFromString("1000000000000000000000000")
142 defaultMultiplier := sdk.NewDec(1)
143
144 tc := TestCase{
145 Name: "tc2",
146 Setup: struct {
147 Accounts []banktypes.Balance
148 Margin *margintypes.GenesisState
149 RewardsParams clptypes.RewardParams
150 ProtectionParams clptypes.LiquidityProtectionParams
151 ShiftingParams clptypes.PmtpParams
152 ProviderParams clptypes.ProviderDistributionParams
153 }{
154 Accounts: balances,
155 ShiftingParams: *clptypes.GetDefaultPmtpParams(),
156 RewardsParams: clptypes.RewardParams{
157 LiquidityRemovalLockPeriod: 0,
158 LiquidityRemovalCancelPeriod: 0,
159 RewardPeriods: []*clptypes.RewardPeriod{
160 &clptypes.RewardPeriod{
161 RewardPeriodId: "1",
162 RewardPeriodStartBlock: 1,
163 RewardPeriodEndBlock: 1000,
164 RewardPeriodAllocation: &allocation,
165 RewardPeriodPoolMultipliers: []*clptypes.PoolMultiplier{},
166 RewardPeriodDefaultMultiplier: &defaultMultiplier,
167 RewardPeriodDistribute: false,
168 RewardPeriodMod: 1,
169 },
170 },

Callers 1

TestIntegrationFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected