@@ -146,6 +146,11 @@ func TestQuerier_GetPoolShareEstimate(t *testing.T) {
146
146
expectedExternalAssetAmount sdk.Uint
147
147
expectedNativeAssetAmount sdk.Uint
148
148
expectedPercentage sdk.Dec
149
+ expectedSwapStatus types.SwapStatus
150
+ expectedSwapFee sdk.Uint
151
+ expectedSwapFeeRate sdk.Dec
152
+ expectedSwapAmount sdk.Uint
153
+ expectedSwapResult sdk.Uint
149
154
err error
150
155
errString error
151
156
}{
@@ -164,6 +169,11 @@ func TestQuerier_GetPoolShareEstimate(t *testing.T) {
164
169
expectedExternalAssetAmount : sdk .NewUint (200 ),
165
170
expectedNativeAssetAmount : sdk .NewUint (200 ),
166
171
expectedPercentage : sdk .MustNewDecFromStr ("0.166666666666666667" ),
172
+ expectedSwapStatus : types .SwapStatus_NO_SWAP ,
173
+ expectedSwapFee : sdk .ZeroUint (),
174
+ expectedSwapFeeRate : sdk .ZeroDec (),
175
+ expectedSwapAmount : sdk .ZeroUint (),
176
+ expectedSwapResult : sdk .ZeroUint (),
167
177
},
168
178
{
169
179
name : "asymmetric" ,
@@ -180,6 +190,11 @@ func TestQuerier_GetPoolShareEstimate(t *testing.T) {
180
190
expectedExternalAssetAmount : sdk .NewUint (115 ),
181
191
expectedNativeAssetAmount : sdk .NewUint (138 ),
182
192
expectedPercentage : sdk .MustNewDecFromStr ("0.115826702033598585" ),
193
+ expectedSwapStatus : types .SwapStatus_SELL_NATIVE ,
194
+ expectedSwapFee : sdk .ZeroUint (),
195
+ expectedSwapFeeRate : sdk .MustNewDecFromStr ("0.003" ),
196
+ expectedSwapAmount : sdk .NewUint (61 ),
197
+ expectedSwapResult : sdk .NewUint (114 ),
183
198
},
184
199
}
185
200
@@ -236,6 +251,11 @@ func TestQuerier_GetPoolShareEstimate(t *testing.T) {
236
251
require .Equal (t , tc .expectedExternalAssetAmount .String (), res .ExternalAssetAmount .String ())
237
252
require .Equal (t , tc .expectedNativeAssetAmount .String (), res .NativeAssetAmount .String ())
238
253
require .Equal (t , tc .expectedPercentage .String (), res .Percentage .String ())
254
+ require .Equal (t , tc .expectedSwapStatus , res .SwapInfo .Status )
255
+ require .Equal (t , tc .expectedSwapFee .String (), res .SwapInfo .Fee .String ())
256
+ require .Equal (t , tc .expectedSwapFeeRate .String (), res .SwapInfo .FeeRate .String ())
257
+ require .Equal (t , tc .expectedSwapAmount .String (), res .SwapInfo .Amount .String ())
258
+ require .Equal (t , tc .expectedSwapResult .String (), res .SwapInfo .Result .String ())
239
259
})
240
260
}
241
261
}
0 commit comments