-
Notifications
You must be signed in to change notification settings - Fork 184
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
refactor verification crate & add voyager interface #2288
Conversation
base: BaseVerificationInterface, | ||
} | ||
|
||
#[async_trait] |
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.
#[async_trait]
attribute is not required
|
||
#[derive(Parser)] | ||
#[command(about = "Verify a contract through a block explorer")] | ||
pub struct Verify { |
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.
Please add descriptions of all parameters to display in help
} | ||
|
||
fn gen_explorer_url(&self) -> Result<String> { | ||
let api_base_url = env::var("VOYAGER_API_URL") |
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.
We would like to unify the wole configuration to a TOML file. Could you please redesign the url acquisition logic to use an enum provied via CastConfig
rather than an environmental variable?
#[async_trait] | ||
pub trait VerificationInterface { | ||
fn new(network: Network, workspace_dir: Utf8PathBuf) -> Self; | ||
async fn verify( |
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.
Both implementations of this method are identical. You can make it a default implementation
class_hash: Option<FieldElement>, | ||
class_name: String, | ||
) -> Result<VerifyResponse>; | ||
fn gen_explorer_url(&self) -> Result<String>; |
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.
- Similarly to
verify
, implementations of this method differ only with the url source. How about introducing a new trait method, let's sayget_base_url
, implementing it manually on both types and using in a default implementation ofgen_explorer_url
? - This method never fails. Are there any reasons for it to return a
Result
?
Hi @rjnrohit! Please let us know if you are still working on these features. |
Closing because of lack of activity. |
Closes #2287
Introduced changes
Add voyager verifier to the
sncast
verify command.Checklist
CHANGELOG.md