Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: TestCase Env Update #475

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions examples/nextjs/src/components/feegrant/createObj.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
GRNToString,
MsgCreateObjectTypeUrl,
newBucketGRN,
newObjectGRN,
PermissionTypes,
toTimestamp,
} from '@bnb-chain/greenfield-js-sdk';
Expand Down Expand Up @@ -146,13 +147,28 @@ export const CreateObj = () => {
},
);

const simulateInfo = await createObjectTx.simulate({
const setTagTx = await client.storage.setTag({
operator: granteeAddr,
resource: GRNToString(newObjectGRN(bucketName, objectName)),
tags: {
tags: [
{
key: 'x',
value: 'xx',
},
],
},
});

const multiTx = await client.txClient.multiTx([createObjectTx, setTagTx]);

const simulateInfo = await multiTx.simulate({
denom: 'BNB',
});

console.log('simulateInfo', simulateInfo);

const res = await createObjectTx.broadcast({
const res = await multiTx.broadcast({
denom: 'BNB',
gasLimit: Number(simulateInfo?.gasLimit),
gasPrice: simulateInfo?.gasPrice || '5000000000',
Expand Down
4 changes: 2 additions & 2 deletions packages/js-sdk/tests/.env.simple
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ACCOUNT_ADDRESS='0x...'
ACCOUNT_PRIVATEKEY='0x...'
NEXT_PUBLIC_GREENFIELD_RPC_URL=https://gnfd-testnet-fullnode-tendermint-ap.bnbchain.org
NEXT_PUBLIC_GREEN_CHAIN_ID=5600
GREENFIELD_URL=https://gnfd-testnet-fullnode-tendermint-ap.bnbchain.org
GREENFIELD_CHAIN_ID=5600
Loading
Loading