-
Notifications
You must be signed in to change notification settings - Fork 17
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
contract: add my_derived_public_key() #691
Conversation
chain-signatures/contract/src/lib.rs
Outdated
@@ -373,6 +374,19 @@ impl VersionedMpcContract { | |||
} | |||
} | |||
|
|||
/// This is the derived key given path | |||
pub fn my_derived_public_key(&self, path: String) -> PublicKey { |
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.
Don't think my
adds any more info here, and we should just keep consistent with verbs in contract interfaces. How about we just rename to derive_public_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.
changed it to derived_public_key() to be consistent with public_key()
chain-signatures/contract/src/lib.rs
Outdated
pub fn derived_public_key(&self, path: String) -> PublicKey { | ||
let predecessor = env::predecessor_account_id(); |
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 think we should add in an option where people can specify the predecessor account id since the one calling this function might or might not be the right one. Like in this case:
user.near calls nft.near
nft.near calls sign
predecessor_id = nft.near
user.near calls derived_public_key
predecessor_id = user.near
pub fn derived_public_key(&self, path: String) -> PublicKey { | |
let predecessor = env::predecessor_account_id(); | |
pub fn derived_public_key(&self, path: String, predecessor: Option<AccountId>) -> PublicKey { | |
let predecessor = predecessor.unwrap_or_else(env::predecessor_account_id); |
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.
sweet. Will do.
Terraform Feature Environment Destroy (dev-691)Terraform Initialization ⚙️
|
No description provided.