Skip to content

Commit 2a8b883

Browse files
authored
use get_underlying_decimals for curve aave/compound (#26)
Co-authored-by: le.cao <[email protected]>
1 parent 1f9feba commit 2a8b883

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

pkg/source/curve/constant.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
registryOrFactoryMethodIsMeta = "is_meta"
1414
registryOrFactoryMethodGetBasePool = "get_base_pool"
1515
registryOrFactoryMethodGetDecimals = "get_decimals"
16+
registryOrFactoryMethodGetUnderDecimals = "get_underlying_decimals"
1617
registryOrFactoryMethodGetRates = "get_rates"
1718
registryOrFactoryMethodGetLpToken = "get_lp_token"
1819

pkg/source/curve/pool_aave.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (d *PoolsListUpdater) getNewPoolsTypeAave(
4545
calls.AddCall(&ethrpc.Call{
4646
ABI: *poolAndRegistry.RegistryOrFactoryABI,
4747
Target: *poolAndRegistry.RegistryOrFactoryAddress,
48-
Method: registryOrFactoryMethodGetDecimals,
48+
Method: registryOrFactoryMethodGetUnderDecimals,
4949
Params: []interface{}{poolAndRegistry.PoolAddress},
5050
}, []interface{}{&decimals[i]})
5151

pkg/source/curve/pool_base.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func (d *PoolsListUpdater) getNewPoolsTypeBase(
2020
) ([]entity.Pool, error) {
2121
var (
2222
coins = make([][8]common.Address, len(poolAndRegistries))
23-
underlyingCoins = make([][8]common.Address, len(poolAndRegistries))
2423
decimals = make([][8]*big.Int, len(poolAndRegistries))
2524
aList = make([]*big.Int, len(poolAndRegistries))
2625
aPreciseList = make([]*big.Int, len(poolAndRegistries))
@@ -38,13 +37,6 @@ func (d *PoolsListUpdater) getNewPoolsTypeBase(
3837
Params: []interface{}{poolAndRegistry.PoolAddress},
3938
}, []interface{}{&coins[i]})
4039

41-
calls.AddCall(&ethrpc.Call{
42-
ABI: *poolAndRegistry.RegistryOrFactoryABI,
43-
Target: *poolAndRegistry.RegistryOrFactoryAddress,
44-
Method: registryOrFactoryMethodGetUnderlyingCoins,
45-
Params: []interface{}{poolAndRegistry.PoolAddress},
46-
}, []interface{}{&underlyingCoins[i]})
47-
4840
calls.AddCall(&ethrpc.Call{
4941
ABI: *poolAndRegistry.RegistryOrFactoryABI,
5042
Target: *poolAndRegistry.RegistryOrFactoryAddress,

pkg/source/curve/pool_compound.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (d *PoolsListUpdater) getNewPoolsTypeCompound(
4646
calls.AddCall(&ethrpc.Call{
4747
ABI: *poolAndRegistry.RegistryOrFactoryABI,
4848
Target: *poolAndRegistry.RegistryOrFactoryAddress,
49-
Method: registryOrFactoryMethodGetDecimals,
49+
Method: registryOrFactoryMethodGetUnderDecimals,
5050
Params: []interface{}{poolAndRegistry.PoolAddress},
5151
}, []interface{}{&decimals[i]})
5252

0 commit comments

Comments
 (0)