Skip to content

Commit

Permalink
fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Aug 13, 2024
1 parent 68841f6 commit 64425ed
Showing 1 changed file with 60 additions and 105 deletions.
165 changes: 60 additions & 105 deletions src/testcases/parallel/grpc_queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,90 +107,69 @@ describe('Neutron / Grpc Queries', () => {

describe('Grpc queries', () => {
test('bank balance should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
bank_balance: {
address: neutronWallet.address,
denom: NEUTRON_DENOM,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
bank_balance: {
address: neutronWallet.address,
denom: NEUTRON_DENOM,
},
);
});
expect(res.balance.denom).toBe('untrn');
expect(+res.balance.amount).toBeGreaterThan(1000000);
});

test('bank denom metadata should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
bank_denom_metadata: {
denom: newTokenDenom,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
bank_denom_metadata: {
denom: newTokenDenom,
},
);
});
expect(res.metadata.denom_units[0].denom).toBe(newTokenDenom);
});

test('bank params should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
bank_params: {},
},
);
const res = await neutronClient.queryContractSmart(contractAddress, {
bank_params: {},
});
expect(res.params.default_send_enabled).toBe(true);
});

test('bank supply of should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
bank_supply_of: {
denom: NEUTRON_DENOM,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
bank_supply_of: {
denom: NEUTRON_DENOM,
},
);
});
expect(res.amount.denom).toBe('untrn');
expect(+res.amount.amount).toBeGreaterThan(1000000);
});

// response with the field of type `Any` is expected, but actual type is a different struct
test.skip('auth account should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
auth_account: {
address: neutronWallet.address,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
auth_account: {
address: neutronWallet.address,
},
);
});
expect(res.account.address).toBe(neutronWallet.address);
});

test('transfer denom trace should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
transfer_denom_trace: {
hash: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
},
const res = await neutronClient.queryContractSmart(contractAddress, {
transfer_denom_trace: {
hash: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
},
);
});
expect(res.denom_trace.path).toBe('transfer/channel-0');
expect(res.denom_trace.base_denom).toBe('uatom');
});

// response with the field of type `Any` is expected, but actual type is a different struct
test.skip('ibc client state should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
ibc_client_state: {
client_id: '07-tendermint-1',
},
const res = await neutronClient.queryContractSmart(contractAddress, {
ibc_client_state: {
client_id: '07-tendermint-1',
},
);
});
expect(res.client_state['@type']).toBe(
'/ibc.lightclients.tendermint.v1.ClientState',
);
Expand All @@ -199,98 +178,74 @@ describe('Neutron / Grpc Queries', () => {

// response with the field of type `Any` is expected, but actual type is a different struct
test.skip('ibc consensus state should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
ibc_consensus_state: {
client_id: '07-tendermint-1',
revision_number: 0,
revision_height: 0,
latest_height: true,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
ibc_consensus_state: {
client_id: '07-tendermint-1',
revision_number: 0,
revision_height: 0,
latest_height: true,
},
);
});
expect(res.consensus_state['@type']).toBe(
'/ibc.lightclients.tendermint.v1.ConsensusState',
);
expect(+res.proof_height.revision_height).toBeGreaterThan(0);
});

test('ibc connection should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
ibc_connection: {
connection_id: 'connection-0',
},
const res = await neutronClient.queryContractSmart(contractAddress, {
ibc_connection: {
connection_id: 'connection-0',
},
);
});
expect(res.connection.client_id).toBe('07-tendermint-1');
expect(+res.proof_height.revision_height).toBeGreaterThan(0);
});

test('tokenfactory params should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
tokenfactory_params: {},
},
);
const res = await neutronClient.queryContractSmart(contractAddress, {
tokenfactory_params: {},
});
expect(res.params.denom_creation_gas_consume).toBe('0');
});

test('tokenfactory denom authority metadata should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
tokenfactory_denom_authority_metadata: {
creator: neutronWallet.address,
subdenom: newTokenDenom,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
tokenfactory_denom_authority_metadata: {
creator: neutronWallet.address,
subdenom: newTokenDenom,
},
);
});
expect(res.authority_metadata.admin).toBe('');
});

test('tokenfactory denoms from creator should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
tokenfactory_denoms_from_creator: {
creator: neutronWallet.address,
},
const res = await neutronClient.queryContractSmart(contractAddress, {
tokenfactory_denoms_from_creator: {
creator: neutronWallet.address,
},
);
});
expect(res.denoms[0]).toBe(newTokenDenom);
});

test('interchaintxs params should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
interchaintxs_params: {},
},
);
const res = await neutronClient.queryContractSmart(contractAddress, {
interchaintxs_params: {},
});
expect(+res.params.msg_submit_tx_max_messages).toBeGreaterThan(0);
});

test('interchainqueries params should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
interchainqueries_params: {},
},
);
const res = await neutronClient.queryContractSmart(contractAddress, {
interchainqueries_params: {},
});
expect(+res.params.query_submit_timeout).toBeGreaterThan(0);
});

test('feeburner params should work', async () => {
const res = await neutronClient.queryContractSmart(
contractAddress,
{
feeburner_params: {},
},
);
const res = await neutronClient.queryContractSmart(contractAddress, {
feeburner_params: {},
});
expect(res.params.neutron_denom).toBe('untrn');
});
});
Expand Down

0 comments on commit 64425ed

Please sign in to comment.