From 667540aaab37248caee3289e3f2a2a5d085a16c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Fri, 22 Sep 2023 13:19:12 +0200 Subject: [PATCH] client-sdk: Add new pool addresses --- client-sdk/go/helpers/address.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/client-sdk/go/helpers/address.go b/client-sdk/go/helpers/address.go index 1c576c2b3e..deb685bc23 100644 --- a/client-sdk/go/helpers/address.go +++ b/client-sdk/go/helpers/address.go @@ -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" @@ -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. @@ -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 default: return nil, nil, fmt.Errorf("unsupported pool kind: %s", data) }