-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Conversation
f9fcd8a
to
5a40e27
Compare
await Promise.all(deployments); | ||
await self.emitter.emit('postDeployMany', arr); | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(first pass)
} | ||
} | ||
|
||
if (isString && res.result.includes('0x08c379a0')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
}; | ||
|
||
module.exports = Deployment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
For those of us old-heads that like to cat
their files on the terminal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But really I came here to say that _methods
should not be called outside of this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
contract.transactionHash = instance.transactionHash; | ||
return instance; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is a bit long? Maybe worth chopping it into pieces? Up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah but we should at least move the public methods above the private ones.
if (options.save === false) return; | ||
|
||
// Write migrations record to chain | ||
const Migrations = resolver.require("./Migrations.sol"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolver.require("Migrations")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. Need to investigate this a bit. Is the hard-coding of the path (carried over from original) the cause of the bug identified here. Or.....?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just more canonical. Artifacts are by contract
name, not filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The older migrate tests at truffle-core
crash when this change is made. I want to deal with separately from this PR as a bug in the resolver - not sure what's going here....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's another round of review. I think you said you have some more changes you want to make, so I'll wait for those to then try to catch anything I missed.
All-in-all, this is an impressive effort.
} | ||
|
||
web3 | ||
.eth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of prefer the way you had it with web3.eth
. I'd also be into web3.eth.estimateGas(params)
all on one line, but I can see why separating it looks nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
web3.currentProvider.send(packet, (err, response) => { | ||
if (response && (response.error || response.result)) { | ||
reason = execute.extractReason(response, web3) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the if
just be moved into extractReason
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so provider.send()
still only uses a callback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
(params.gas) | ||
? accept({gas: params.gas, error: err}) | ||
: accept({gas: null, error: err}); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all really pretty
return web3.eth.abi.decodeParameter('string', data[hash].return.slice(10)) | ||
} | ||
|
||
} else if (isString && res.result.includes('0x08c379a0')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's that value? I think let's make this a const
at the top of the function so it gets a name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm. yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess derived from this axic comment in the EIP ? 🙂
Now we could instead just assume that there is a generic error with a signature of Error(string), which hashes to 08c379a0 followed by an ABI encoded string, therefore revert("oh noes") would result in the data 08c379a0 00...20 00..07 6f68206e6f6573..00
@@ -131,6 +176,7 @@ var execute = { | |||
var args = Array.prototype.slice.call(arguments); | |||
var params = utils.getTxParams.call(constructor, args); | |||
var promiEvent = new Web3PromiEvent(); | |||
var reason; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to be used
|
||
const util = require('util'); | ||
|
||
class Migration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, one of these!
}; | ||
} | ||
|
||
// ------------------------------------- Public ------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait you're doing private
first? That's cool as long as we're consistent.
" ⠏" | ||
] | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there's gotta be a better way to get indents under control.
} | ||
} | ||
|
||
module.exports = MigrationsMessages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dig the messages separation of concerns
} | ||
|
||
module.exports = Reporter; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add truffle-reporters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -13,6 +13,7 @@ contract Example { | |||
// Constructor revert | |||
require(val != 13); | |||
require(val != 2001, 'reasonstring'); | |||
require(val != 20001, 'solidity storage is a fun lesson in endianness'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
Aiiii!!!! It's over. |
Opening to keep track of what still needs to be done this week.
wild-truffle
for monorepo and check colonyNetwork / aragon migrationsGists of the output (So we can start to make this look better)
geth --dev
)E2E Testing vs. Rinkeby / Ropsten / MintTestNet (Settlemint/Parity POA network)
Everything is set up here to deploy Consensys/PLCRToken to these testnets. Just clone repo (recursively), set up a
secrets.js
with a funded mnenomic, and follow README instructions to install and run at this branch's current commit.Known Problems
geth ws is broken for large data sends & web3 1.0 has broken confirmations polling over rpc.(Fix w/ block-polling)sendAsync
method, renaming itsend
.provider-engine
hatessend
though because it used to be sync. Believe this will require we temporarily fork provider-engine.Account are not really forking.(Fixed at ganache, awaiting publication)Goals
--dry-run
Example command
Example config
GIF
Visual Review (future improvements):
--only
flag