Add handling for hh 2.11.0

0.7.22
cgewecke 2 years ago
parent 5174ecdfce
commit 08ff0fb871
  1. 4
      .circleci/config.yml
  2. 5
      lib/api.js
  3. 8
      lib/collector.js
  4. 3
      scripts/run-zeppelin.sh

@ -12,8 +12,8 @@ step_install_nvm: &step_install_nvm
set +e set +e
export NVM_DIR="/opt/circleci/.nvm" export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install v12.16.0 nvm install v14.19.0
nvm alias default v12.16.0 nvm alias default v14.19.0
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV

@ -282,7 +282,12 @@ class API {
while (cur._wrapped) { while (cur._wrapped) {
cur = Object.assign({}, cur._wrapped) cur = Object.assign({}, cur._wrapped)
} }
if (cur._node._vm.on) {
cur._node._vm.on('step', self.collector.step.bind(self.collector)) cur._node._vm.on('step', self.collector.step.bind(self.collector))
} else {
cur._node._vm.evm.events.on('step', self.collector.step.bind(self.collector))
}
} }
// Temporarily disabled because some relevant traces aren't available // Temporarily disabled because some relevant traces aren't available

@ -22,7 +22,13 @@ class DataCollector {
try { try {
if (this.validOpcodes[info.opcode.name] && info.stack.length > 0){ if (this.validOpcodes[info.opcode.name] && info.stack.length > 0){
const idx = info.stack.length - 1; const idx = info.stack.length - 1;
let hash = web3Utils.toHex(info.stack[idx]).toString();
let hash;
if (typeof info.stack[idx] === 'bigint') {
hash = '0x' + info.stack[idx].toString(16);
} else {
hash = web3Utils.toHex(info.stack[idx]).toString();
}
this._registerHash(hash) this._registerHash(hash)
} }
} catch (err) { /*Ignore*/ }; } catch (err) { /*Ignore*/ };

@ -28,6 +28,9 @@ cd openzeppelin-contracts
echo ">>>>> npm install" echo ">>>>> npm install"
npm install npm install
# Use HH Merge version to test dual vm patch
npm install hardhat@latest
echo ">>>>> npm uninstall solidity-coverage --save-dev" echo ">>>>> npm uninstall solidity-coverage --save-dev"
npm uninstall solidity-coverage --save-dev npm uninstall solidity-coverage --save-dev

Loading…
Cancel
Save