Skip to content

Don't automatically exclude files ending in Upgradeable #157

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions contracts/solc-0.6/AlreadyUpgradeable.sol

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mapValues } from 'lodash';
import { minimatch } from 'minimatch';

import { matcher } from './utils/matcher';
import { renamePath, isRenamed } from './rename';
import { renamePath } from './rename';
import { SolcOutput, SolcInput } from './solc/input-output';
import { Transform } from './transform';
import { generateWithInit } from './generate-with-init';
Expand Down Expand Up @@ -90,7 +90,7 @@ export async function transpile(
};

const transform = new Transform(solcInput, solcOutput, {
exclude: source => excludeSet.has(source) || (excludeMatch(source) ?? isRenamed(source)),
exclude: source => excludeSet.has(source) || !!excludeMatch(source),
});

if (options.peerProject !== undefined) {
Expand Down
6 changes: 0 additions & 6 deletions src/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ test('transform contract name', t => {
t.snapshot(t.context.transform.results()[file]);
});

test('skip contract rename when Upgradeable suffix', t => {
const file = 'contracts/solc-0.6/AlreadyUpgradeable.sol';
t.context.transform.apply(renameContractDefinition);
t.snapshot(t.context.transform.results()[file]);
});

test('fix import directives', t => {
const file = 'contracts/solc-0.6/Local.sol';
t.context.transform.apply(fixImportDirectives(false));
Expand Down
10 changes: 0 additions & 10 deletions src/transform.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,6 @@ Generated by [AVA](https://avajs.dev).
}␊
`

## skip contract rename when Upgradeable suffix

> Snapshot 1

`pragma solidity ^0.6.0;␊
contract AlreadyUpgradeable {␊
}␊
`

## fix import directives

> Snapshot 1
Expand Down
Binary file modified src/transform.test.ts.snap
Binary file not shown.