|
| 1 | +package ds |
| 2 | + |
| 3 | +import ( |
| 4 | + "math/big" |
| 5 | + |
| 6 | + "github.com/Gearbox-protocol/sdk-go/artifacts/dataCompressor/mainnet" |
| 7 | + "github.com/Gearbox-protocol/sdk-go/core" |
| 8 | + "github.com/Gearbox-protocol/sdk-go/core/schemas" |
| 9 | + "github.com/Gearbox-protocol/third-eye/ds/dc_wrapper" |
| 10 | +) |
| 11 | + |
| 12 | +type DummyRepo struct { |
| 13 | +} |
| 14 | + |
| 15 | +// sync adapters |
| 16 | +func (DummyRepo) GetKit() *AdapterKit { |
| 17 | + return nil |
| 18 | +} |
| 19 | +func (DummyRepo) AddSyncAdapter(adapterI SyncAdapterI) { |
| 20 | +} |
| 21 | +func (DummyRepo) InitChecks() { |
| 22 | +} |
| 23 | +func (DummyRepo) GetChainId() uint { |
| 24 | + return 0 |
| 25 | +} |
| 26 | + |
| 27 | +// saving to the db |
| 28 | +func (DummyRepo) Flush() error { |
| 29 | + return nil |
| 30 | +} |
| 31 | + |
| 32 | +// adding block/timestamp |
| 33 | +func (DummyRepo) SetBlock(blockNum int64) { |
| 34 | +} |
| 35 | +func (DummyRepo) SetAndGetBlock(blockNum int64) *schemas.Block { |
| 36 | + return nil |
| 37 | +} |
| 38 | +func (DummyRepo) GetBlocks() map[int64]*schemas.Block { |
| 39 | + return nil |
| 40 | +} |
| 41 | +func (DummyRepo) GetTokenOracles() map[int16]map[string]*schemas.TokenOracle { |
| 42 | + return nil |
| 43 | +} |
| 44 | +func (DummyRepo) GetDisabledTokens() []*schemas.AllowedToken { |
| 45 | + return nil |
| 46 | +} |
| 47 | +func (DummyRepo) LoadBlocks(from, to int64) { |
| 48 | +} |
| 49 | + |
| 50 | +// credit account operations |
| 51 | +func (DummyRepo) AddAccountOperation(accountOperation *schemas.AccountOperation) { |
| 52 | +} |
| 53 | + |
| 54 | +// for getting executeparser |
| 55 | +func (DummyRepo) GetExecuteParser() ExecuteParserI { |
| 56 | + return nil |
| 57 | +} |
| 58 | + |
| 59 | +// price feed/oracle funcs |
| 60 | +func (DummyRepo) DirectlyAddTokenOracle(tokenOracle *schemas.TokenOracle) { |
| 61 | +} |
| 62 | +func (DummyRepo) AddPriceFeed(pf *schemas.PriceFeed) { |
| 63 | +} |
| 64 | + |
| 65 | +// token funcs |
| 66 | +func (DummyRepo) AddAllowedProtocol(logID uint, txHash, creditFilter string, p *schemas.Protocol) { |
| 67 | +} |
| 68 | +func (DummyRepo) DisableProtocol(blockNum int64, logID uint, txHash, cm, creditFilter, protocol string) { |
| 69 | +} |
| 70 | +func (DummyRepo) AddAllowedToken(logID uint, txHash, creditFilter string, atoken *schemas.AllowedToken) { |
| 71 | +} |
| 72 | +func (DummyRepo) DisableAllowedToken(blockNum int64, logID uint, txHash string, creditManager, creditFilter, token string) { |
| 73 | +} |
| 74 | + |
| 75 | +// v2 |
| 76 | +func (DummyRepo) AddAllowedTokenV2(logID uint, txHash, creditFilter string, atoken *schemas.AllowedToken) { |
| 77 | +} |
| 78 | +func (DummyRepo) UpdateLimits(logID uint, txHash, creditConfigurator string, params *schemas.Parameters) { |
| 79 | +} |
| 80 | +func (DummyRepo) UpdateFees(logID uint, txHash, creditConfigurator string, params *schemas.Parameters) { |
| 81 | +} |
| 82 | +func (DummyRepo) TransferAccountAllowed(*schemas.TransferAccountAllowed) { |
| 83 | +} |
| 84 | +func (DummyRepo) GetPricesInUSD(blockNum int64, tokenAddrs []string) core.JsonFloatMap { |
| 85 | + return nil |
| 86 | +} |
| 87 | + |
| 88 | +// |
| 89 | +func (DummyRepo) GetToken(addr string) *schemas.Token { |
| 90 | + return nil |
| 91 | +} |
| 92 | +func (DummyRepo) GetTokens() []string { |
| 93 | + return nil |
| 94 | +} |
| 95 | +func (DummyRepo) ConvertToBalanceWithMask(balances []mainnet.DataTypesTokenBalance, mask *big.Int) (*core.JsonBalance, error) { |
| 96 | + return nil, nil |
| 97 | +} |
| 98 | + |
| 99 | +// credit session funcs |
| 100 | +func (DummyRepo) AddCreditSession(session *schemas.CreditSession, loadedFromDB bool, txHash string, logID uint) { |
| 101 | +} |
| 102 | +func (DummyRepo) GetCreditSession(sessionId string) *schemas.CreditSession { |
| 103 | + return nil |
| 104 | +} |
| 105 | +func (DummyRepo) UpdateCreditSession(sessionId string, values map[string]interface{}) *schemas.CreditSession { |
| 106 | + return nil |
| 107 | +} |
| 108 | +func (DummyRepo) GetSessions() map[string]*schemas.CreditSession { |
| 109 | + return nil |
| 110 | +} |
| 111 | +func (DummyRepo) GetValueInCurrency(blockNum int64, version int16, token, currency string, amount *big.Int) *big.Int { |
| 112 | + return nil |
| 113 | +} |
| 114 | +func (DummyRepo) AddDieselToken(dieselToken, underlyingToken, pool string) { |
| 115 | +} |
| 116 | +func (DummyRepo) GetDieselTokens() map[string]*schemas.UTokenAndPool { |
| 117 | + return nil |
| 118 | +} |
| 119 | + |
| 120 | +// credit session snapshots funcs |
| 121 | +func (DummyRepo) AddCreditSessionSnapshot(css *schemas.CreditSessionSnapshot) { |
| 122 | +} |
| 123 | + |
| 124 | +// dc |
| 125 | +func (DummyRepo) GetDCWrapper() *dc_wrapper.DataCompressorWrapper { |
| 126 | + return nil |
| 127 | +} |
| 128 | + |
| 129 | +// pools |
| 130 | +func (DummyRepo) AddPoolStat(ps *schemas.PoolStat) { |
| 131 | +} |
| 132 | +func (DummyRepo) AddPoolLedger(pl *schemas.PoolLedger) { |
| 133 | +} |
| 134 | +func (DummyRepo) GetPoolUniqueUserLen(pool string) int { |
| 135 | + return 0 |
| 136 | +} |
| 137 | +func (DummyRepo) IsDieselToken(token string) bool { |
| 138 | + return false |
| 139 | +} |
| 140 | +func (DummyRepo) GetWETHAddr() string { |
| 141 | + return "" |
| 142 | +} |
| 143 | +func (DummyRepo) GetUSDCAddr() string { |
| 144 | + return "" |
| 145 | +} |
| 146 | +func (DummyRepo) GetGearTokenAddr() string { |
| 147 | + return "" |
| 148 | +} |
| 149 | + |
| 150 | +// credit manager |
| 151 | +func (DummyRepo) AddAccountTokenTransfer(tt *schemas.TokenTransfer) { |
| 152 | +} |
| 153 | +func (DummyRepo) AddCreditManagerToFilter(cmAddr, cfAddr string) { |
| 154 | +} |
| 155 | +func (DummyRepo) GetMask(blockNum int64, cmAddr, accountAddr string, version int16) *big.Int { |
| 156 | + return nil |
| 157 | +} |
| 158 | +func (DummyRepo) AddCreditManagerStats(cms *schemas.CreditManagerStat) { |
| 159 | +} |
| 160 | +func (DummyRepo) GetCMState(cmAddr string) *schemas.CreditManagerState { |
| 161 | + return nil |
| 162 | +} |
| 163 | +func (DummyRepo) GetUnderlyingDecimal(cmAddr string) int8 { |
| 164 | + return 0 |
| 165 | +} |
| 166 | +func (DummyRepo) AddRepayOnCM(cm string, pnl schemas.PnlOnRepay) { |
| 167 | +} |
| 168 | +func (DummyRepo) AddParameters(logID uint, txHash string, params *schemas.Parameters, token string) { |
| 169 | +} |
| 170 | +func (DummyRepo) AddFastCheckParams(logID uint, txHash, cm, creditFilter string, fcParams *schemas.FastCheckParams) { |
| 171 | +} |
| 172 | +func (DummyRepo) AfterSync(blockNum int64) { |
| 173 | +} |
| 174 | +func (DummyRepo) GetAccountManager() *DirectTransferManager { |
| 175 | + return nil |
| 176 | +} |
| 177 | +func (DummyRepo) AddAccountAddr(account string) { |
| 178 | +} |
| 179 | + |
| 180 | +// dao |
| 181 | +func (DummyRepo) AddDAOOperation(operation *schemas.DAOOperation) { |
| 182 | +} |
| 183 | +func (DummyRepo) CalCurrentTreasuryValue(syncTill int64) { |
| 184 | +} |
| 185 | +func (DummyRepo) AddTreasuryTransfer(blockNum int64, logID uint, token string, amount *big.Int) { |
| 186 | +} |
| 187 | +func (DummyRepo) RecentEventMsg(blockNum int64, msg string, args ...interface{}) { |
| 188 | +} |
| 189 | + |
| 190 | +// |
| 191 | +// oracle and uni |
| 192 | +func (DummyRepo) AddUniswapPrices(prices *schemas.UniPoolPrices) { |
| 193 | +} |
| 194 | +func (DummyRepo) GetYearnFeedAddrs() []string { |
| 195 | + return nil |
| 196 | +} |
| 197 | + |
| 198 | +// has mutex lock |
| 199 | +func (DummyRepo) AddNewPriceOracleEvent(*schemas.TokenOracle) { |
| 200 | +} |
| 201 | + |
| 202 | +// |
| 203 | +func (DummyRepo) LoadLastDebtSync() int64 { |
| 204 | + return 0 |
| 205 | +} |
| 206 | +func (DummyRepo) LoadLastAdapterSync() int64 { |
| 207 | + return 0 |
| 208 | +} |
| 209 | +func (DummyRepo) Clear() { |
| 210 | +} |
| 211 | + |
| 212 | +// multicall |
| 213 | +func (DummyRepo) GetUniPricesByToken(token string) []*schemas.UniPoolPrices { |
| 214 | + return nil |
| 215 | +} |
| 216 | +func (DummyRepo) AddUniPoolsForToken(blockNum int64, token string) { |
| 217 | +} |
| 218 | +func (DummyRepo) AddUniPriceAndChainlinkRelation(relation *schemas.UniPriceAndChainlink) { |
| 219 | +} |
| 220 | +func (DummyRepo) AddLastSyncForToken(token string, lastSync int64) { |
| 221 | +} |
| 222 | + |
| 223 | +// for testing |
| 224 | +func (DummyRepo) AddTokenObj(token *schemas.Token) { |
| 225 | +} |
| 226 | +func (DummyRepo) PrepareSyncAdapter(adapter *SyncAdapter) SyncAdapterI { |
| 227 | + return nil |
| 228 | +} |
0 commit comments