/
store_model.go
84 lines (63 loc) · 2.03 KB
/
store_model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package model
import (
"encoding/json"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/merlins-labs/merlins/v17/x/cosmwasmpool/types"
poolmanagertypes "github.com/merlins-labs/merlins/v17/x/poolmanager/types"
)
var (
_ poolmanagertypes.PoolI = &CosmWasmPool{}
_ types.CosmWasmExtension = &CosmWasmPool{}
)
// String returns the json marshalled string of the pool
func (p CosmWasmPool) String() string {
out, err := json.Marshal(p)
if err != nil {
panic(err)
}
return string(out)
}
// poolmanager.PoolI interface implementation
func (p CosmWasmPool) GetAddress() sdk.AccAddress {
return sdk.MustAccAddressFromBech32(p.ContractAddress)
}
func (p CosmWasmPool) GetId() uint64 {
panic("CosmWasmPool.GetId not implemented")
}
func (p CosmWasmPool) GetSpreadFactor(ctx sdk.Context) sdk.Dec {
panic("CosmWasmPool.GetSpreadFactor not implemented")
}
func (p CosmWasmPool) GetExitFee(ctx sdk.Context) sdk.Dec {
panic("CosmWasmPool.GetExitFee not implemented")
}
func (p CosmWasmPool) IsActive(ctx sdk.Context) bool {
panic("CosmWasmPool.IsActive not implemented")
}
func (p CosmWasmPool) SpotPrice(ctx sdk.Context, baseAssetDenom string, quoteAssetDenom string) (sdk.Dec, error) {
panic("CosmWasmPool.SpotPrice not implemented")
}
func (p CosmWasmPool) GetType() poolmanagertypes.PoolType {
return poolmanagertypes.CosmWasm
}
func (p CosmWasmPool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins {
panic("CosmWasmPool.GetTotalPoolLiquidity not implemented")
}
// types.CosmWasmExtension interface implementation
func (p CosmWasmPool) GetCodeId() uint64 {
return p.CodeId
}
func (p CosmWasmPool) GetInstantiateMsg() []byte {
return p.InstantiateMsg
}
func (p CosmWasmPool) GetContractAddress() string {
return p.ContractAddress
}
func (p *CosmWasmPool) SetContractAddress(contractAddress string) {
p.ContractAddress = contractAddress
}
func (p CosmWasmPool) GetStoreModel() poolmanagertypes.PoolI {
return &p
}
func (p CosmWasmPool) SetWasmKeeper(wasmKeeper types.WasmKeeper) {
panic("CosmWasmPool.SetWasmKeeeper not implemented")
}