Skip to content

Commit

Permalink
client-sdk: Add new pool addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Sep 22, 2023
1 parent 0f0f7d4 commit 667540a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions client-sdk/go/helpers/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

"github.com/oasisprotocol/oasis-sdk/client-sdk/go/config"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/crypto/signature/secp256k1"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/accounts"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/consensusaccounts"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/rewards"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/testing"
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/types"
Expand All @@ -24,7 +26,11 @@ const (
addressExplicitPool = "pool"
addressExplicitTest = "test"

poolRewards = "rewards"
poolCommon = "common"
poolFeeAccumulator = "fee-accumulator"
poolRewards = "rewards"
poolPendingWithdrawal = "pending-withdrawal"
poolPendingDelegation = "pending-delegation"
)

// ResolveAddress resolves a string address into the corresponding account address.
Expand All @@ -50,8 +56,17 @@ func ResolveAddress(net *config.Network, address string) (*types.Address, *ethCo
// Pool.
switch data {
case poolRewards:
// Reward pool address.
return &rewards.RewardPoolAddress, nil, nil
case poolCommon:
// TODO: Consensus common pool. Should check, if ParaTime is used or not.
return &accounts.CommonPoolAddress, nil, nil
case poolFeeAccumulator:
// TODO: Consensus fee accumulator. Should check, if ParaTime is used or not.
return &accounts.FeeAccumulatorAddress, nil, nil
case poolPendingWithdrawal:
return &consensusaccounts.PendingWithdrawalAddress, nil, nil
case poolPendingDelegation:
return &consensusaccounts.PendingDelegationAddress, nil, nil

Check warning on line 69 in client-sdk/go/helpers/address.go

View check run for this annotation

Codecov / codecov/patch

client-sdk/go/helpers/address.go#L60-L69

Added lines #L60 - L69 were not covered by tests
default:
return nil, nil, fmt.Errorf("unsupported pool kind: %s", data)
}
Expand Down

0 comments on commit 667540a

Please sign in to comment.