Skip to content

Commit

Permalink
Fix rebase errors & regenerate yarn.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke committed Apr 26, 2022
1 parent 88c1d00 commit 3bcec94
Show file tree
Hide file tree
Showing 2 changed files with 7,021 additions and 2,238 deletions.
12 changes: 6 additions & 6 deletions lib/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Injector {
*/
_getDefaultMethodDefinition(id){
const hash = web3Utils.keccak256(id).slice(2,10);
const method = this._getMethodIdentifier(id);
const method = this._getDefaultMethodIdentifier(id);
return `\nfunction ${method}(bytes8 c__${hash}) internal pure {}\n`;
}

Expand All @@ -97,7 +97,7 @@ class Injector {
_getTrueMethodDefinition(id){
const hash = web3Utils.keccak256(id).slice(2,10);
const method = this._getTrueMethodIdentifier(id);
return `function ${method}(bytes8 c__${hash}) public pure returns (bool){ return true; }\n`;
return `function ${method}(bytes8 c__${hash}) internal pure returns (bool){ return true; }\n`;
}

/**
Expand All @@ -109,7 +109,7 @@ class Injector {
_getFalseMethodDefinition(id){
const hash = web3Utils.keccak256(id).slice(2,10);
const method = this._getFalseMethodIdentifier(id);
return `function ${method}(bytes8 c__${hash}) public pure returns (bool){ return false; }\n`;
return `function ${method}(bytes8 c__${hash}) internal pure returns (bool){ return false; }\n`;
}

_getModifierDefinitions(contractId, instrumentation){
Expand Down Expand Up @@ -308,12 +308,12 @@ class Injector {
const end = contract.instrumented.slice(injectionPoint);
const id = `${fileName}:${injection.contractName}`;

const defaultMethodDefinition = (injection.isFileScoped)
const methodDefinition = (injection.isFileScoped)
? this._getFileScopedHashMethodDefinition(id)
: this._getHashMethodDefinition(id);
: this._getDefaultMethodDefinition(id);

contract.instrumented = `${start}` +
`${defaultMethodDefinition}` +
`${methodDefinition}` +
`${this._getTrueMethodDefinition(id)}` +
`${this._getFalseMethodDefinition(id)}` +
`${this._getModifierDefinitions(id, instrumentation)}` +
Expand Down

0 comments on commit 3bcec94

Please sign in to comment.