Skip to content

Commit

Permalink
test: Delete policy case
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Apr 22, 2024
1 parent 4047f35 commit 2cbdb99
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/bsc-cross-sdk/tests/multiMessage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ResourceType } from '@bnb-chain/greenfield-cosmos-types/greenfield/reso
import {
ActionType,
Effect,
PrincipalType,
} from '@bnb-chain/greenfield-cosmos-types/greenfield/permission/common';
import { CrossChainClient } from '../src/client/cross-chain';
import { MultiMessageClient } from '../src/client/multi-message';
Expand Down Expand Up @@ -51,6 +52,9 @@ describe('base', () => {
// const gasPrice = crossChainClient.getCallbackGasPrice();
const bucketName = generateString(10);

// eslint-disable-next-line no-console
console.log('bucketName', bucketName);

const { relayFee, minAckRelayFee } = await crossChainClient.getRelayFee();

const args = multiMsgClient.createBucket(
Expand Down Expand Up @@ -199,7 +203,7 @@ describe('base', () => {
const args = multiMsgClient.createPolicy(
{
id: '0',
resourceId: '180009',
resourceId: '234011',
resourceType: ResourceType.RESOURCE_TYPE_BUCKET,
statements: [
{
Expand All @@ -208,6 +212,31 @@ describe('base', () => {
resources: [],
},
],
principal: {
type: PrincipalType.PRINCIPAL_TYPE_GNFD_ACCOUNT,
value: '0x0C02787e83948e7aD29abE3a99b29c480f9F0096',
},
},
{
sender: account.address,
minAckRelayFee,
relayFee,
},
);

const txHash = await multiMsgClient.sendMessages([args]);

// eslint-disable-next-line no-console
console.log('txHash', txHash);
expect(txHash).toBeDefined();
});

test('deletePolicy', async () => {
const { relayFee, minAckRelayFee } = await crossChainClient.getRelayFee();

const args = multiMsgClient.deletePolicy(
{
id: BigInt(646),
},
{
sender: account.address,
Expand Down

0 comments on commit 2cbdb99

Please sign in to comment.