Skip to content

Commit

Permalink
feat: add PoolIndex in registry fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
kamikazechaser committed Apr 17, 2024
1 parent e4d86ef commit e791284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
GasFaucet = "GasFaucet"
TrainingVoucher = "TrainingVoucher"
TokenIndex = "TokenIndex"
PoolIndex = "PoolIndex"
)

// RegistryMap auto-loads all well known custodial related smart contract addresses through the CICRegistry pointer contract.
Expand All @@ -26,6 +27,7 @@ func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Addre
gasFaucetAddress common.Address
tokenIndexAddress common.Address
trainingVoucherAddress common.Address
poolIndex common.Address
)

err := p.Client.CallCtx(
Expand All @@ -35,6 +37,7 @@ func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Addre
eth.CallFunc(registryAddress, listFunc, common.BytesToHash(common.RightPadBytes([]byte(GasFaucet), 32))).Returns(&gasFaucetAddress),
eth.CallFunc(registryAddress, listFunc, common.BytesToHash(common.RightPadBytes([]byte(TokenIndex), 32))).Returns(&tokenIndexAddress),
eth.CallFunc(registryAddress, listFunc, common.BytesToHash(common.RightPadBytes([]byte(TrainingVoucher), 32))).Returns(&trainingVoucherAddress),
eth.CallFunc(registryAddress, listFunc, common.BytesToHash(common.RightPadBytes([]byte(PoolIndex), 32))).Returns(&poolIndex),
)
if err != nil {
return nil, err
Expand All @@ -46,6 +49,7 @@ func (p *Provider) RegistryMap(ctx context.Context, registryAddress common.Addre
registryMap[GasFaucet] = gasFaucetAddress
registryMap[TokenIndex] = tokenIndexAddress
registryMap[TrainingVoucher] = trainingVoucherAddress
registryMap[PoolIndex] = poolIndex

return registryMap, nil
}

0 comments on commit e791284

Please sign in to comment.