Include MsgStoreCode among authz grant & revoke options

This commit is contained in:
Serkan Reis 2024-01-16 18:30:13 +03:00
parent 58ae7c05af
commit 57fabf90da
2 changed files with 13 additions and 0 deletions

View File

@ -39,6 +39,7 @@ export type GenericAuthorizationType =
| 'MsgSend'
| 'MsgExecuteContract'
| 'MsgMigrateContract'
| 'MsgStoreCode'
const Grant: NextPage = () => {
const wallet = useWallet()
@ -189,6 +190,14 @@ const Grant: NextPage = () => {
(expiration?.getTime() as number) / 1000 || 0,
)
}
if (genericAuthType === 'MsgStoreCode') {
return AuthzGenericGrantMsg(
wallet.address || '',
granteeAddressState.value,
'/cosmwasm.wasm.v1.MsgStoreCode',
(expiration?.getTime() as number) / 1000 || 0,
)
}
} else if (authType === 'Send') {
return AuthzSendGrantMsg(
wallet.address || '',
@ -272,6 +281,7 @@ const Grant: NextPage = () => {
<option value="MsgVote">Vote</option>
<option value="MsgExecuteContract">Execute Contract</option>
<option value="MsgMigrateContract">Migrate Contract</option>
<option value="MsgStoreCode">Store Code</option>
</select>
</div>
</Conditional>

View File

@ -119,6 +119,9 @@ const RevokeAuthorization: NextPage = () => {
<option className="bg-black" value="/cosmwasm.wasm.v1.MsgMigrateContract">
/cosmwasm.wasm.v1.MsgMigrateContract
</option>
<option className="bg-black" value="/cosmwasm.wasm.v1.MsgStoreCode">
/cosmwasm.wasm.v1.MsgStoreCode
</option>
<option className="bg-black" disabled value="/cosmos.bank.v1beta1.SendAuthorization">
/cosmos.bank.v1beta1.SendAuthorization
</option>