Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Danno Ferrin <[email protected]>
  • Loading branch information
shemnon committed Jul 25, 2022
1 parent 3e10ae6 commit ce57069
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/relay/tests/lib/eth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ import cache from 'js-cache';
dotenv.config({ path: path.resolve(__dirname, '../test.env') });
import { RelayImpl } from '@hashgraph/json-rpc-relay';
import { EthImpl } from '../../src/lib/eth';
import { MirrorNodeClient } from '../../src/lib/clients/mirrorNodeClient';
import MirrorNodeClient from '../../src/lib/clients/mirrorNodeClient';
import { MirrorNode } from '../../src/lib/mirrorNode';
import { expectUnsupportedMethod } from '../helpers';

import pino from 'pino';
import { Block, Transaction } from '../../src/lib/model';
import constants from '../../src/lib/constants';
import { SDKClient } from '../../src/lib/clients';
import { TextEncoder } from 'util';
const logger = pino();
const registry = new Registry();
const Relay = new RelayImpl(logger, registry);
Expand Down Expand Up @@ -1336,6 +1335,7 @@ describe('Eth calls using MirrorNode', async function () {
}, 'latest')

sinon.assert.calledWith(sdkClientStub.submitContractCallQuery, contractAddress2, contractCallData, 400_000, contractAddress1, 'eth_call');
expect(result).to.equal("0x00")
});

it('eth_call with no data', async function () {
Expand All @@ -1346,13 +1346,14 @@ describe('Eth calls using MirrorNode', async function () {
}
);

await ethImpl.call({
var result = await ethImpl.call({
"from": contractAddress1,
"to": contractAddress2,
"gas": maxGasLimitHex
}, 'latest')

sinon.assert.calledWith(sdkClientStub.submitContractCallQuery, contractAddress2, undefined, maxGasLimit, contractAddress1, 'eth_call');
expect(result).to.equal("0x00")
});

it('eth_call with no from address', async function () {
Expand All @@ -1370,6 +1371,7 @@ describe('Eth calls using MirrorNode', async function () {
}, 'latest')

sinon.assert.calledWith(sdkClientStub.submitContractCallQuery, contractAddress2, contractCallData, maxGasLimit, undefined, 'eth_call');
expect(result).to.equal("0x00")
});

it('eth_call with all fields', async function () {
Expand All @@ -1388,6 +1390,7 @@ describe('Eth calls using MirrorNode', async function () {
}, 'latest')

sinon.assert.calledWith(sdkClientStub.submitContractCallQuery, contractAddress2, contractCallData, maxGasLimit, contractAddress1, 'eth_call');
expect(result).to.equal("0x00")
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/server/tests/acceptance/erc20.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,4 @@ describe('ERC20 Acceptance Tests', async function () {
const evmAddress = Utils.idToEvmAddress(htsResult.receipt.tokenId.toString());
return new ethers.Contract(evmAddress, abi, accounts[0].wallet);
};
});
});

0 comments on commit ce57069

Please sign in to comment.