-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pallet contracts #11
Conversation
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.
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 |
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.
Overall very good. Thank you for doing this!
I left a few small comments. Merge when ready.
node/src/chain_spec.rs
Outdated
// sudo: SudoConfig { | ||
// key: Some(root_key), | ||
// }, |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🤷♂️ .
Makefile
Outdated
watch: | ||
cargo watch -s 'WASM_BUILD_WORKSPACE_HINT=${PWD} CARGO_TARGET_DIR=/tmp/target/ cargo check' -c |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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