Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
resolve and un-skip issue: web3.js#6327
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba committed Sep 26, 2023
1 parent 4d25ae7 commit a66de71
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
4 changes: 1 addition & 3 deletions packages/codec/lib/evm/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export const ZERO_ADDRESS = "0x" + "00".repeat(ADDRESS_SIZE);
export function keccak256(...args: any[]): BN {
// debug("args %o", args);

// TODO: Remove the next line once https://github.com/web3/web3.js/issues/6327 is fixed
// this hacky workaround does not work for large numbers (above 53 bit)
args = args.map(v => (BN.isBN(v) ? v.toNumber() : v));
args = args.map(v => (BN.isBN(v) ? BigInt(v.toString()) : v));
const rawSha: string | null = Web3Utils.soliditySha3(...args);
debug("rawSha %o", rawSha);
let sha: string;
Expand Down
4 changes: 1 addition & 3 deletions packages/debugger/test/data/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ function fileName(testName) {

function generateTests(fixtures) {
for (let { name, value: expected } of fixtures) {
// TODO: un-skip once the following issue have been resolved:
// https://github.com/web3/web3.js/issues/6327
it.skip(`correctly decodes ${name}`, async () => {
it(`correctly decodes ${name}`, async () => {
const response = await this.decode(name);
assert.deepEqual(response, expected);
});
Expand Down
4 changes: 1 addition & 3 deletions packages/debugger/test/data/more-decoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,7 @@ describe("Further Decoding", function () {
assert.deepInclude(variables, expectedResult);
});

// TODO: un-skip once the following issue have been resolved:
// https://github.com/web3/web3.js/issues/6327
it.skip("Decodes inner mappings correctly and keeps path info", async function () {
it("Decodes inner mappings correctly and keeps path info", async function () {
this.timeout(12000);

let instance = await abstractions.ComplexMappingTest.deployed();
Expand Down
3 changes: 0 additions & 3 deletions packages/debugger/test/stacktrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ const migrations = {
"2_deploy_contracts.js": __MIGRATION
};

// TODO: un-skip once the following issue have been resolved:
// https://github.com/web3/web3.js/issues/6327 (soliditySha3 behave differently on 4.x when one of the values is BN)
// To test run: cd packages/debugger && yarn test test/stacktrace.js
describe("Stack tracing", function () {
let provider;
let abstractions;
Expand Down
13 changes: 1 addition & 12 deletions packages/decoder/test/current/test/decoding-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,7 @@ describe("State variable decoding", function () {
abstractions = prepared.abstractions;
});

//todo debug test
//should get the initial state properly:
//
// AssertionError [ERR_ASSERTION]: '0' == '4'
// + expected - actual
//
// -0
// +4
// TODO: un-skip once the following has been resolved
// https://github.com/web3/web3.js/issues/6327 (soliditySha3 behave differently on 4.x when one of the values is BN)

it.skip("should get the initial state properly", async function () {
it("should get the initial state properly", async function () {
let deployedContract = await abstractions.DecodingSample.deployed();
let address = deployedContract.address;
const decoder = await Decoder.forContractInstance(deployedContract);
Expand Down

0 comments on commit a66de71

Please sign in to comment.