diff --git a/testutil/keeper/authority.go b/testutil/keeper/authority.go index 6e131a41a5..169b6df526 100644 --- a/testutil/keeper/authority.go +++ b/testutil/keeper/authority.go @@ -80,14 +80,14 @@ func MockCheckAuthorization(m *mock.Mock, msg sdk.Msg, authorizationResult error m.On("CheckAuthorization", mock.Anything, msg).Return(authorizationResult).Once() } -// MockGetChainList mocks the GetChainList method of the authority keeper. +// MockGetChainList mocks the GetAdditionalChainList method of the authority keeper. func MockGetChainList(m *mock.Mock, chainList []chains.Chain) { - m.On("GetChainList", mock.Anything).Return(chainList).Once() + m.On("GetAdditionalChainList", mock.Anything).Return(chainList).Once() } -// MockGetChainListEmpty mocks the GetChainList method of the authority keeper. +// MockGetChainListEmpty mocks the GetAdditionalChainList method of the authority keeper. func MockGetChainListEmpty(m *mock.Mock) { - m.On("GetChainList", mock.Anything).Return([]chains.Chain{}) + m.On("GetAdditionalChainList", mock.Anything).Return([]chains.Chain{}) } func SetAdminPolicies(ctx sdk.Context, ak *keeper.Keeper) string { diff --git a/testutil/keeper/mocks/crosschain/authority.go b/testutil/keeper/mocks/crosschain/authority.go index da7f95ae91..d38c117dd6 100644 --- a/testutil/keeper/mocks/crosschain/authority.go +++ b/testutil/keeper/mocks/crosschain/authority.go @@ -32,12 +32,12 @@ func (_m *CrosschainAuthorityKeeper) CheckAuthorization(ctx types.Context, msg t return r0 } -// GetChainList provides a mock function with given fields: ctx -func (_m *CrosschainAuthorityKeeper) GetChainList(ctx types.Context) []chains.Chain { +// GetAdditionalChainList provides a mock function with given fields: ctx +func (_m *CrosschainAuthorityKeeper) GetAdditionalChainList(ctx types.Context) []chains.Chain { ret := _m.Called(ctx) if len(ret) == 0 { - panic("no return value specified for GetChainList") + panic("no return value specified for GetAdditionalChainList") } var r0 []chains.Chain diff --git a/testutil/keeper/mocks/fungible/authority.go b/testutil/keeper/mocks/fungible/authority.go index b2e9f34106..ed9dbd0e28 100644 --- a/testutil/keeper/mocks/fungible/authority.go +++ b/testutil/keeper/mocks/fungible/authority.go @@ -32,12 +32,12 @@ func (_m *FungibleAuthorityKeeper) CheckAuthorization(ctx types.Context, msg typ return r0 } -// GetChainList provides a mock function with given fields: ctx -func (_m *FungibleAuthorityKeeper) GetChainList(ctx types.Context) []chains.Chain { +// GetAdditionalChainList provides a mock function with given fields: ctx +func (_m *FungibleAuthorityKeeper) GetAdditionalChainList(ctx types.Context) []chains.Chain { ret := _m.Called(ctx) if len(ret) == 0 { - panic("no return value specified for GetChainList") + panic("no return value specified for GetAdditionalChainList") } var r0 []chains.Chain diff --git a/testutil/keeper/mocks/lightclient/authority.go b/testutil/keeper/mocks/lightclient/authority.go index 2c503a6843..8d058dbfc0 100644 --- a/testutil/keeper/mocks/lightclient/authority.go +++ b/testutil/keeper/mocks/lightclient/authority.go @@ -32,12 +32,12 @@ func (_m *LightclientAuthorityKeeper) CheckAuthorization(ctx types.Context, msg return r0 } -// GetChainList provides a mock function with given fields: ctx -func (_m *LightclientAuthorityKeeper) GetChainList(ctx types.Context) []chains.Chain { +// GetAdditionalChainList provides a mock function with given fields: ctx +func (_m *LightclientAuthorityKeeper) GetAdditionalChainList(ctx types.Context) []chains.Chain { ret := _m.Called(ctx) if len(ret) == 0 { - panic("no return value specified for GetChainList") + panic("no return value specified for GetAdditionalChainList") } var r0 []chains.Chain diff --git a/testutil/keeper/mocks/observer/authority.go b/testutil/keeper/mocks/observer/authority.go index e10760cb43..9150ffcfc5 100644 --- a/testutil/keeper/mocks/observer/authority.go +++ b/testutil/keeper/mocks/observer/authority.go @@ -34,12 +34,12 @@ func (_m *ObserverAuthorityKeeper) CheckAuthorization(ctx types.Context, msg typ return r0 } -// GetChainList provides a mock function with given fields: ctx -func (_m *ObserverAuthorityKeeper) GetChainList(ctx types.Context) []chains.Chain { +// GetAdditionalChainList provides a mock function with given fields: ctx +func (_m *ObserverAuthorityKeeper) GetAdditionalChainList(ctx types.Context) []chains.Chain { ret := _m.Called(ctx) if len(ret) == 0 { - panic("no return value specified for GetChainList") + panic("no return value specified for GetAdditionalChainList") } var r0 []chains.Chain diff --git a/x/authority/keeper/chain_info.go b/x/authority/keeper/chain_info.go index 7c982d3018..2a096a5ae2 100644 --- a/x/authority/keeper/chain_info.go +++ b/x/authority/keeper/chain_info.go @@ -26,9 +26,9 @@ func (k Keeper) GetChainInfo(ctx sdk.Context) (val types.ChainInfo, found bool) return val, true } -// GetChainList returns the list of chains in chain info object +// GetAdditionalChainList returns the list of chains in chain info object // returns empty list if no chains are present -func (k Keeper) GetChainList(ctx sdk.Context) (list []chains.Chain) { +func (k Keeper) GetAdditionalChainList(ctx sdk.Context) (list []chains.Chain) { chainInfo, found := k.GetChainInfo(ctx) if !found { return diff --git a/x/authority/keeper/chain_info_test.go b/x/authority/keeper/chain_info_test.go index a284b1cc0f..59f1714504 100644 --- a/x/authority/keeper/chain_info_test.go +++ b/x/authority/keeper/chain_info_test.go @@ -36,7 +36,7 @@ func TestKeeper_GetChainList(t *testing.T) { k, ctx := keepertest.AuthorityKeeper(t) // Empty list - list := k.GetChainList(ctx) + list := k.GetAdditionalChainList(ctx) require.Empty(t, list) // Set chain info @@ -44,6 +44,6 @@ func TestKeeper_GetChainList(t *testing.T) { k.SetChainInfo(ctx, chainInfo) // Check list - list = k.GetChainList(ctx) + list = k.GetAdditionalChainList(ctx) require.Equal(t, chainInfo.Chains, list) } diff --git a/x/crosschain/keeper/abci.go b/x/crosschain/keeper/abci.go index 10888b5adf..f7935e4360 100644 --- a/x/crosschain/keeper/abci.go +++ b/x/crosschain/keeper/abci.go @@ -45,7 +45,7 @@ func (k Keeper) IterateAndUpdateCctxGasPrice( return 0, gasPriceIncreaseFlags } - additionalChains := k.GetAuthorityKeeper().GetChainList(ctx) + additionalChains := k.GetAuthorityKeeper().GetAdditionalChainList(ctx) cctxCount := 0 diff --git a/x/crosschain/keeper/cctx_gateway_observers.go b/x/crosschain/keeper/cctx_gateway_observers.go index a6b3d6ddbd..18bf31afb8 100644 --- a/x/crosschain/keeper/cctx_gateway_observers.go +++ b/x/crosschain/keeper/cctx_gateway_observers.go @@ -43,7 +43,7 @@ func (c CCTXGatewayObservers) InitiateOutbound( noEthereumTxEvent := false if chains.IsZetaChain( config.CCTX.InboundParams.SenderChainId, - c.crosschainKeeper.GetAuthorityKeeper().GetChainList(ctx), + c.crosschainKeeper.GetAuthorityKeeper().GetAdditionalChainList(ctx), ) { noEthereumTxEvent = true } diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index 1258bbb348..7c91440d7f 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -121,7 +121,7 @@ func (k Keeper) validateFailedOutboundObservers(ctx sdk.Context, cctx *types.Cro // if the cctx is of coin type cmd or the sender chain is zeta chain, then we do not revert, the cctx is aborted cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed cctx.SetAbort("Outbound failed") - } else if chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetChainList(ctx)) { + } else if chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { switch cctx.InboundParams.CoinType { // Try revert if the coin-type is ZETA case coin.CoinType_Zeta: diff --git a/x/crosschain/keeper/evm_deposit.go b/x/crosschain/keeper/evm_deposit.go index 729c0c58de..0b60a3c9e6 100644 --- a/x/crosschain/keeper/evm_deposit.go +++ b/x/crosschain/keeper/evm_deposit.go @@ -78,7 +78,7 @@ func (k Keeper) HandleEVMDeposit(ctx sdk.Context, cctx *types.CrossChainTx) (boo to = parsedAddress } - from, err := chains.DecodeAddressFromChainID(inboundSenderChainID, inboundSender, k.GetAuthorityKeeper().GetChainList(ctx)) + from, err := chains.DecodeAddressFromChainID(inboundSenderChainID, inboundSender, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) if err != nil { return false, fmt.Errorf("HandleEVMDeposit: unable to decode address: %s", err.Error()) } diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index de8053ae6e..6f62458c54 100644 --- a/x/crosschain/keeper/evm_hooks.go +++ b/x/crosschain/keeper/evm_hooks.go @@ -272,7 +272,7 @@ func (k Keeper) ProcessZetaSentEvent( func (k Keeper) ValidateZrc20WithdrawEvent(ctx sdk.Context, event *zrc20.ZRC20Withdrawal, chainID int64) error { // The event was parsed; that means the user has deposited tokens to the contract. - if chains.IsBitcoinChain(chainID, k.GetAuthorityKeeper().GetChainList(ctx)) { + if chains.IsBitcoinChain(chainID, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { if event.Value.Cmp(big.NewInt(constant.BTCWithdrawalDustAmount)) < 0 { return errorsmod.Wrapf( types.ErrInvalidWithdrawalAmount, diff --git a/x/crosschain/keeper/grpc_query_cctx_rate_limit.go b/x/crosschain/keeper/grpc_query_cctx_rate_limit.go index 0f284b167d..d2eb8d85ea 100644 --- a/x/crosschain/keeper/grpc_query_cctx_rate_limit.go +++ b/x/crosschain/keeper/grpc_query_cctx_rate_limit.go @@ -64,7 +64,7 @@ func (k Keeper) RateLimiterInput( // if a cctx is an outgoing cctx that orginates from ZetaChain // reverted incoming cctx has an external `SenderChainId` and should not be counted isCCTXOutgoing := func(cctx *types.CrossChainTx) bool { - return chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetChainList(ctx)) + return chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) } // it is a past cctx if its nonce < `nonceLow`, @@ -272,7 +272,7 @@ func (k Keeper) ListPendingCctxWithinRateLimit( // if a cctx is outgoing from ZetaChain // reverted incoming cctx has an external `SenderChainId` and should not be counted isCCTXOutgoing := func(cctx *types.CrossChainTx) bool { - return chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetChainList(ctx)) + return chains.IsZetaChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) } // query pending nonces for each foreign chain and get the lowest height of the pending cctxs diff --git a/x/crosschain/keeper/grpc_query_zeta_conversion_rate.go b/x/crosschain/keeper/grpc_query_zeta_conversion_rate.go index 40019b6c88..ff7178fdd7 100644 --- a/x/crosschain/keeper/grpc_query_zeta_conversion_rate.go +++ b/x/crosschain/keeper/grpc_query_zeta_conversion_rate.go @@ -19,7 +19,7 @@ func (k Keeper) ConvertGasToZeta( request *types.QueryConvertGasToZetaRequest, ) (*types.QueryConvertGasToZetaResponse, error) { ctx := sdk.UnwrapSDKContext(context) - chain := chains.GetChainFromChainID(request.ChainId, k.GetAuthorityKeeper().GetChainList(ctx)) + chain := chains.GetChainFromChainID(request.ChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) if chain == nil { return nil, zetaObserverTypes.ErrSupportedChains diff --git a/x/crosschain/keeper/initiate_outbound.go b/x/crosschain/keeper/initiate_outbound.go index a4ab254ede..0275997e24 100644 --- a/x/crosschain/keeper/initiate_outbound.go +++ b/x/crosschain/keeper/initiate_outbound.go @@ -24,7 +24,7 @@ type InitiateOutboundConfig struct { // which handles the state changes and error handling. func (k Keeper) InitiateOutbound(ctx sdk.Context, config InitiateOutboundConfig) (types.CctxStatus, error) { receiverChainID := config.CCTX.GetCurrentOutboundParam().ReceiverChainId - chainInfo := chains.GetChainFromChainID(receiverChainID, k.GetAuthorityKeeper().GetChainList(ctx)) + chainInfo := chains.GetChainFromChainID(receiverChainID, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) if chainInfo == nil { return config.CCTX.CctxStatus.Status, cosmoserrors.Wrap( types.ErrInitiatitingOutbound, diff --git a/x/crosschain/keeper/msg_server_add_outbound_tracker.go b/x/crosschain/keeper/msg_server_add_outbound_tracker.go index 9b94875e82..8a16fec7cc 100644 --- a/x/crosschain/keeper/msg_server_add_outbound_tracker.go +++ b/x/crosschain/keeper/msg_server_add_outbound_tracker.go @@ -138,7 +138,7 @@ func verifyProofAndOutboundBody(ctx sdk.Context, k msgServer, msg *types.MsgAddO // get tss address var bitcoinChainID int64 - if chains.IsBitcoinChain(msg.ChainId, k.GetAuthorityKeeper().GetChainList(ctx)) { + if chains.IsBitcoinChain(msg.ChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { bitcoinChainID = msg.ChainId } diff --git a/x/crosschain/keeper/msg_server_migrate_tss_funds.go b/x/crosschain/keeper/msg_server_migrate_tss_funds.go index 19f23e0c33..f5558fe689 100644 --- a/x/crosschain/keeper/msg_server_migrate_tss_funds.go +++ b/x/crosschain/keeper/msg_server_migrate_tss_funds.go @@ -147,7 +147,7 @@ func (k Keeper) MigrateTSSFundsForChain( } // retrieve from authority keeper additional chains - additionalChains := k.GetAuthorityKeeper().GetChainList(ctx) + additionalChains := k.GetAuthorityKeeper().GetAdditionalChainList(ctx) // Set the sender and receiver addresses for EVM chain if chains.IsEVMChain(chainID, additionalChains) { diff --git a/x/crosschain/keeper/refund.go b/x/crosschain/keeper/refund.go index 18c87b8186..a741434705 100644 --- a/x/crosschain/keeper/refund.go +++ b/x/crosschain/keeper/refund.go @@ -70,7 +70,7 @@ func (k Keeper) RefundAmountOnZetaChainZeta( refundAmount := GetAbortedAmount(cctx) chainID := cctx.InboundParams.SenderChainId // check if chain is an EVM chain - if !chains.IsEVMChain(chainID, k.GetAuthorityKeeper().GetChainList(ctx)) { + if !chains.IsEVMChain(chainID, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { return errors.New("only EVM chains are supported for refund when coin type is Zeta") } if cctx.InboundParams.Amount.IsNil() || cctx.InboundParams.Amount.IsZero() { @@ -96,7 +96,7 @@ func (k Keeper) RefundAmountOnZetaChainERC20( if cctx.InboundParams.CoinType != coin.CoinType_ERC20 { return errors.New("unsupported coin type for refund on ZetaChain") } - if !chains.IsEVMChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetChainList(ctx)) { + if !chains.IsEVMChain(cctx.InboundParams.SenderChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) { return errors.New("only EVM chains are supported for refund on ZetaChain") } diff --git a/x/crosschain/types/expected_keepers.go b/x/crosschain/types/expected_keepers.go index 3e37b3cb1e..e3f46c203a 100644 --- a/x/crosschain/types/expected_keepers.go +++ b/x/crosschain/types/expected_keepers.go @@ -209,7 +209,7 @@ type FungibleKeeper interface { type AuthorityKeeper interface { CheckAuthorization(ctx sdk.Context, msg sdk.Msg) error - GetChainList(ctx sdk.Context) (list []chains.Chain) + GetAdditionalChainList(ctx sdk.Context) (list []chains.Chain) } type LightclientKeeper interface { diff --git a/x/fungible/keeper/evm.go b/x/fungible/keeper/evm.go index fe0012e43f..e206b885c0 100644 --- a/x/fungible/keeper/evm.go +++ b/x/fungible/keeper/evm.go @@ -110,7 +110,7 @@ func (k Keeper) DeployZRC20Contract( erc20Contract string, gasLimit *big.Int, ) (common.Address, error) { - chain := chains.GetChainFromChainID(chainID, k.GetAuthorityKeeper().GetChainList(ctx)) + chain := chains.GetChainFromChainID(chainID, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) if chain == nil { return common.Address{}, cosmoserrors.Wrapf(zetaObserverTypes.ErrSupportedChains, "chain %d not found", chainID) } diff --git a/x/fungible/keeper/gas_coin_and_pool.go b/x/fungible/keeper/gas_coin_and_pool.go index 935eb8a64f..6dd60fdb7c 100644 --- a/x/fungible/keeper/gas_coin_and_pool.go +++ b/x/fungible/keeper/gas_coin_and_pool.go @@ -29,7 +29,7 @@ func (k Keeper) SetupChainGasCoinAndPool( gasLimit *big.Int, ) (ethcommon.Address, error) { // additional on-chain static chain information - additionalChains := k.GetAuthorityKeeper().GetChainList(ctx) + additionalChains := k.GetAuthorityKeeper().GetAdditionalChainList(ctx) chain := chains.GetChainFromChainID(chainID, additionalChains) if chain == nil { diff --git a/x/fungible/types/expected_keepers.go b/x/fungible/types/expected_keepers.go index 227f35e57f..758e4ded6e 100644 --- a/x/fungible/types/expected_keepers.go +++ b/x/fungible/types/expected_keepers.go @@ -60,5 +60,5 @@ type EVMKeeper interface { type AuthorityKeeper interface { CheckAuthorization(ctx sdk.Context, msg sdk.Msg) error - GetChainList(ctx sdk.Context) (list []chains.Chain) + GetAdditionalChainList(ctx sdk.Context) (list []chains.Chain) } diff --git a/x/lightclient/keeper/grpc_query_prove.go b/x/lightclient/keeper/grpc_query_prove.go index 8c781a7ebd..b231906501 100644 --- a/x/lightclient/keeper/grpc_query_prove.go +++ b/x/lightclient/keeper/grpc_query_prove.go @@ -26,7 +26,7 @@ func (k Keeper) Prove(c context.Context, req *types.QueryProveRequest) (*types.Q // additionalChains is a list of additional chains to search from // it is used in the protocol to dynamically support new chains without doing an upgrade - additionalChains := k.GetAuthorityKeeper().GetChainList(ctx) + additionalChains := k.GetAuthorityKeeper().GetAdditionalChainList(ctx) blockHash, err := chains.StringToHash(req.ChainId, req.BlockHash, additionalChains) if err != nil { diff --git a/x/lightclient/keeper/proof.go b/x/lightclient/keeper/proof.go index 5c69685e85..ddc26eb12f 100644 --- a/x/lightclient/keeper/proof.go +++ b/x/lightclient/keeper/proof.go @@ -25,7 +25,7 @@ func (k Keeper) VerifyProof( // additionalChains is a list of additional chains to search from // it is used in the protocol to dynamically support new chains without doing an upgrade - additionalChains := k.GetAuthorityKeeper().GetChainList(ctx) + additionalChains := k.GetAuthorityKeeper().GetAdditionalChainList(ctx) // get block header from the store hashBytes, err := chains.StringToHash(chainID, blockHash, additionalChains) diff --git a/x/lightclient/types/expected_keepers.go b/x/lightclient/types/expected_keepers.go index f88e4862a5..71f83b2c49 100644 --- a/x/lightclient/types/expected_keepers.go +++ b/x/lightclient/types/expected_keepers.go @@ -8,5 +8,5 @@ import ( type AuthorityKeeper interface { CheckAuthorization(ctx sdk.Context, msg sdk.Msg) error - GetChainList(ctx sdk.Context) (list []chains.Chain) + GetAdditionalChainList(ctx sdk.Context) (list []chains.Chain) } diff --git a/x/observer/keeper/chain_params.go b/x/observer/keeper/chain_params.go index 7435b16360..e977cfa19a 100644 --- a/x/observer/keeper/chain_params.go +++ b/x/observer/keeper/chain_params.go @@ -51,7 +51,7 @@ func (k Keeper) GetSupportedChainFromChainID(ctx sdk.Context, chainID int64) *ch for _, cp := range cpl.ChainParams { if cp.ChainId == chainID && cp.IsSupported { - return chains.GetChainFromChainID(chainID, k.GetAuthorityKeeper().GetChainList(ctx)) + return chains.GetChainFromChainID(chainID, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) } } return nil @@ -67,7 +67,7 @@ func (k Keeper) GetSupportedChains(ctx sdk.Context) []*chains.Chain { var c []*chains.Chain for _, cp := range cpl.ChainParams { if cp.IsSupported { - c = append(c, chains.GetChainFromChainID(cp.ChainId, k.GetAuthorityKeeper().GetChainList(ctx))) + c = append(c, chains.GetChainFromChainID(cp.ChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx))) } } return c diff --git a/x/observer/keeper/msg_server_reset_chain_nonces.go b/x/observer/keeper/msg_server_reset_chain_nonces.go index 3b78f7a893..c6ae4ddeb0 100644 --- a/x/observer/keeper/msg_server_reset_chain_nonces.go +++ b/x/observer/keeper/msg_server_reset_chain_nonces.go @@ -27,7 +27,7 @@ func (k msgServer) ResetChainNonces( return nil, types.ErrTssNotFound } - chain := chains.GetChainFromChainID(msg.ChainId, k.GetAuthorityKeeper().GetChainList(ctx)) + chain := chains.GetChainFromChainID(msg.ChainId, k.GetAuthorityKeeper().GetAdditionalChainList(ctx)) if chain == nil { return nil, types.ErrSupportedChains } diff --git a/x/observer/types/expected_keepers.go b/x/observer/types/expected_keepers.go index 03cac1fba6..4a556d4fa4 100644 --- a/x/observer/types/expected_keepers.go +++ b/x/observer/types/expected_keepers.go @@ -34,7 +34,7 @@ type StakingHooks interface { type AuthorityKeeper interface { CheckAuthorization(ctx sdk.Context, msg sdk.Msg) error - GetChainList(ctx sdk.Context) (list []chains.Chain) + GetAdditionalChainList(ctx sdk.Context) (list []chains.Chain) // SetPolicies is solely used for the migration of policies from observer to authority SetPolicies(ctx sdk.Context, policies authoritytypes.Policies)