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

Method ExtractValues

x/clp/types/types.go:21–39  ·  view source on GitHub ↗
(to Asset)

Source from the content-addressed store, hash-verified

19}
20
21func (p *Pool) ExtractValues(to Asset) (sdk.Uint, sdk.Uint, bool, Asset) {
22 var X, Y sdk.Uint
23 var from Asset
24 var toRowan bool
25
26 if to.IsSettlementAsset() {
27 Y = p.NativeAssetBalance
28 X = p.ExternalAssetBalance
29 toRowan = true
30 from = *p.ExternalAsset
31 } else {
32 X = p.NativeAssetBalance
33 Y = p.ExternalAssetBalance
34 toRowan = false
35 from = GetSettlementAsset()
36 }
37
38 return X, Y, toRowan, from
39}
40
41func (p *Pool) UpdateBalances(toRowan bool, X, x, Y, swapResult sdk.Uint) {
42 if toRowan {

Callers 6

CLPCalcSwapMethod · 0.80
SwapOneFunction · 0.80
GetSwapFeeFunction · 0.80
VerifyCloseFunction · 0.80

Calls 2

IsSettlementAssetMethod · 0.80
GetSettlementAssetFunction · 0.70

Tested by 1