adm: Use ContractStorageReader for reading methods #1009

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/ape_read_withot_wallet into master 2024-03-05 12:34:56 +00:00
Member

Since ContractStorageReader was introduced, reader method like get-admin and list-rule-chains should use it. This allows to use methods without wallets

Since `ContractStorageReader` was introduced, reader method like `get-admin` and `list-rule-chains` should use it. **This allows to use methods without wallets**
aarifullin requested review from storage-core-committers 2024-02-26 16:27:52 +00:00
aarifullin requested review from storage-core-developers 2024-02-26 16:27:59 +00:00
fyrchik requested changes 2024-02-26 16:32:42 +00:00
@ -97,2 +95,3 @@
var w *wallet.Wallet
committeeAcc, err := helper.GetWalletAccount(wallets[0], constants.CommitteeAccountName)
walletPath := viper.GetString(commonflags.AlphabetWalletsFlag)
Owner

We can have config file which contains endpoint in wallets.
I would rather provide an explicit option here or even split newPolicyContractInterface() into, the first one is called from read methods, and the second one (current) is called from other places.

We can have config file which contains endpoint in wallets. I would rather provide an explicit option here or even split `newPolicyContractInterface()` into, the first one is called from read methods, and the second one (current) is called from other places.
Author
Member

I have introduced newPolicyContractReaderInterface and used it for get-admin and list-targets

I have introduced `newPolicyContractReaderInterface` and used it for `get-admin` and `list-targets`
@ -99,0 +104,4 @@
// TODO (aarifullin): this workaround that creates a dummy wallet is used to create
// Actor without alpabet wallet. It is necessary to get rid of this workaround
// when ContractStorageReader will be introduced in policy engine.
w = wallet.NewInMemoryWallet()
Owner

we can just use wallet.NewAccount() and use committeeAcc, err = helper.GetWalletAccount(w, constants.CommitteeAccountName) only inside the first branch

we can just use `wallet.NewAccount()` and use `committeeAcc, err = helper.GetWalletAccount(w, constants.CommitteeAccountName)` only inside the first branch
Author
Member

Fixed

Fixed
fyrchik marked this conversation as resolved
aarifullin changed title from adm: Make workarount for get-admin and list-rule-chains to adm: Make workaround for get-admin and list-rule-chains 2024-02-27 08:41:32 +00:00
aarifullin force-pushed fix/ape_read_withot_wallet from e743e65d2c to 7d5d11a2a8 2024-02-27 08:54:25 +00:00 Compare
aarifullin requested review from fyrchik 2024-02-27 09:44:50 +00:00
fyrchik approved these changes 2024-02-28 18:59:34 +00:00
aarifullin force-pushed fix/ape_read_withot_wallet from 7d5d11a2a8 to 2fa24dfcda 2024-02-29 08:18:00 +00:00 Compare
aarifullin requested review from fyrchik 2024-02-29 08:18:32 +00:00
aarifullin force-pushed fix/ape_read_withot_wallet from 2fa24dfcda to afccd2dfc8 2024-03-05 07:56:37 +00:00 Compare
fyrchik approved these changes 2024-03-05 07:57:19 +00:00
aarifullin changed title from adm: Make workaround for get-admin and list-rule-chains to adm: Use ContractStorageReader for reading methods 2024-03-05 07:57:33 +00:00
fyrchik added the
bug
label 2024-03-05 07:57:51 +00:00
fyrchik added this to the v0.38.0 milestone 2024-03-05 07:57:56 +00:00
acid-ant approved these changes 2024-03-05 08:14:00 +00:00
fyrchik approved these changes 2024-03-05 08:15:02 +00:00
fyrchik added the
frostfs-adm
label 2024-03-05 08:15:16 +00:00
dstepanov-yadro approved these changes 2024-03-05 08:21:05 +00:00
fyrchik merged commit b84cf91f73 into master 2024-03-05 12:34:56 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1009
No description provided.