• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

embark-framework / embark / 6449
51%

Build:
DEFAULT BRANCH: master
Ran 17 Feb 2021 11:26AM UTC
Jobs 2
Files 46
Run time 50s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6449

cron

travis-ci

Eric Mastro
feat(@embark/core): Recursively import contracts

Add support to recursively import contracts. If we have three contracts

1. A imports B
2. B imports C

Then prior to this PR, contract A would import contract B, and a remapping would be added to the contract so the compiler would know how to find contract B. However, contract B imports contracts C, and because the `parseFileForImport` method was not recursive, the remappings were not able to go one level deeper to remap the path to contract C, and thus the compiler would not know how to locate contract C, and would complain with the error `File outside of allowed directories.`

With the introduction of this PR, the `parseFileForImport` method is now recursive, and so any contract imported is also checked for it's own imports that can be remapped. Specifically, this use case is applicable when there is a dependency containing contracts that imports one of it's own dependency's contracts, ie:

```
pragma solididty ^0.5.0;

import "dependency-1/contract-1.sol";
```
where the dependencies look like:
```
|- node_modules
|--- dependency-1
|----- contract-1.sol <--- contains import "dependency-2/contract-2.sol"
|--- dependency-2
|----- contract-2.sol
```

Add unit tests that verify recursive imports work.
Add embark depdendency that installs a contract used in the recursive unit tests.

7 of 236 branches covered (2.97%)

Branch coverage included in aggregate %.

282 of 999 relevant lines covered (28.23%)

0.66 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6449.1 (EMBARK_NO_PREPARE=true) 17 Feb 2021 11:26AM UTC 0
23.4
Travis Job 6449.1
2 6449.2 (EMBARK_NO_PREPARE=true) 17 Feb 2021 11:26AM UTC 0
23.4
Travis Job 6449.2
Source Files on build 6449
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6449
  • 2613e6d6 on github
  • Prev Build on master (#4419)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc