-
Notifications
You must be signed in to change notification settings - Fork 47
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
Implement the access control feature for Paltalabs #54
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hello @apptreeso @chopan123 |
// This function should be called once when the contract is deployed | ||
pub fn init(env: Env, admin: Address, title: String) { | ||
if env.storage().instance().has(&AdminInfo::Initialized) { | ||
panic!("contract already initilized") |
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 better to throw errors!
Good simple implementation of the access control! I like that the contract is tested in multiple scenarios! But frontend is not even compiling on development... |
I missed to commit one file. I just added it and create a new PR. It works fine. Would you check it? |
Hello @apptreeso your deployment is still failing |
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.
Nice to have onchain tests with chai.
it would be nice to test that another address cannot change the title
} | ||
|
||
#[test] | ||
fn test_set_title_by_owner() { |
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 you are mocking all auths, thats why is working
Hello @apptreeso I reviewed your submission. 1.- You didnt implement any address management, neither on smart contract side, neither on the frontend.
2.- Your preview is failing. As I said, you can check if it will fail by just doing |
No description provided.