Add pallet contracts#11
Conversation
JoshOrndorff
left a comment
There was a problem hiding this comment.
Looking awesome so far. Thank you for doing this!
This PR also fixes clippy lints. Thanks for adding that!
Still todo is the Contracts RPC layer.
It's still a draft, but I cannot mark as draft (because private repo / free plan strikes again :/ ). Will ping you ASAP when ready 4 a review |
JoshOrndorff
left a comment
There was a problem hiding this comment.
Overall very good. Thank you for doing this!
I left a few small comments. Merge when ready.
| // sudo: SudoConfig { | ||
| // key: Some(root_key), | ||
| // }, |
There was a problem hiding this comment.
Is this removed from the autoformatter? If possible I'd like to keep the sudo stuff because we may end up adding it back. Or at least if we want to remove it maybe do so in its own PR so it can be reverted later if we end up needing it.
There was a problem hiding this comment.
blameless, I removed 🙂
YMMV, but as much as I like comments / even TODOs in code, I just find commented out code noisy and unnecessary - because indeed there is version control for that. Not the hill I'm dying on though, so reverting 🤷♂️ .
| watch: | ||
| cargo watch -s 'WASM_BUILD_WORKSPACE_HINT=${PWD} CARGO_TARGET_DIR=/tmp/target/ cargo check' -c |
There was a problem hiding this comment.
DQ, what does this command do? Do you think it is generally useful enough to be worth checking in?
There was a problem hiding this comment.
it's a watcher that runs check on file changes and clears the output afterwards.
But most importantly I'd like to have a Makefile under version control - imho it's the first place one would look into for instructions how to run the project and already ascertains (together with a lock and toolchain file) a good amount of reproducible across developer machine and the CI server (of course completely dockerized env is even better, but takes some work).
At the same time it's completely opt-in, because you can choose to just type the commands in 🤷
| // native chain currency | ||
| pub const TOKEN_DECIMALS: u32 = 12; | ||
| pub const TOKEN: u128 = 10u128.pow(TOKEN_DECIMALS); |
There was a problem hiding this comment.
If we add this constant it should be used throughout. I know at least the faucet would be a place. But actually it is only used in a singe place. I wonder if it is worth adding the constant. Up to you how to proceed.
There was a problem hiding this comment.
good point - i scanned the module and added it where possible, there were a few places - e.g. block rewards).
If it's to be used outside of runtime it might be nice to create a separate module (constants or primitives), wyt?
b0658fc to
362de9a
Compare
adds pallet contracts + RPC endpoints