Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed May 7, 2024
1 parent 3b3e7fb commit 81b0585
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
42 changes: 21 additions & 21 deletions crates/e2e-move-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
pub mod harness;
pub mod test_utils;

use anyhow::bail;
// use anyhow::bail;
pub use harness::*;
use move_package::package_hooks::PackageHooks;
use move_package::source_package::parsed_manifest::CustomDepInfo;
use move_symbol_pool::Symbol;
// use move_package::package_hooks::PackageHooks;
// use move_package::source_package::parsed_manifest::CustomDepInfo;
// use move_symbol_pool::Symbol;

#[cfg(test)]
mod tests;

pub(crate) struct InitiaPackageHooks {}
pub const UPGRADE_POLICY_CUSTOM_FIELD: &str = "upgrade_policy";
// pub(crate) struct InitiaPackageHooks {}
// pub const UPGRADE_POLICY_CUSTOM_FIELD: &str = "upgrade_policy";

impl PackageHooks for InitiaPackageHooks {
fn custom_package_info_fields(&self) -> Vec<String> {
vec![UPGRADE_POLICY_CUSTOM_FIELD.to_string()]
}
// impl PackageHooks for InitiaPackageHooks {
// fn custom_package_info_fields(&self) -> Vec<String> {
// vec![UPGRADE_POLICY_CUSTOM_FIELD.to_string()]
// }

fn custom_dependency_key(&self) -> Option<String> {
Some("initia".to_string())
}
// fn custom_dependency_key(&self) -> Option<String> {
// Some("initia".to_string())
// }

fn resolve_custom_dependency(
&self,
_dep_name: Symbol,
_info: &CustomDepInfo,
) -> anyhow::Result<()> {
bail!("not used")
}
}
// fn resolve_custom_dependency(
// &self,
// _dep_name: Symbol,
// _info: &CustomDepInfo,
// ) -> anyhow::Result<()> {
// bail!("not used")
// }
// }
4 changes: 2 additions & 2 deletions crates/e2e-move-tests/src/test_utils/mock_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl MockStakingAPI {
metadata: AccountAddress,
amount: u64,
) -> anyhow::Result<u64> {
match self.validators.get(&validator.to_vec()) {
match self.validators.get(validator) {
Some(ratios) => match ratios.get(&metadata) {
Some((s, a)) => Ok(amount * s / a),
None => Err(anyhow!("ratio not found")),
Expand All @@ -406,7 +406,7 @@ impl MockStakingAPI {
metadata: AccountAddress,
share: u64,
) -> anyhow::Result<u64> {
match self.validators.get(&validator.to_vec()) {
match self.validators.get(validator) {
Some(ratios) => match ratios.get(&metadata) {
Some((s, a)) => Ok(share * a / s),
None => Err(anyhow!("ratio not found")),
Expand Down
1 change: 1 addition & 0 deletions libmovevm/src/move_api/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub trait Bytecode {

fn address_identifier_at(&self, idx: AddressIdentifierIndex) -> &AccountAddress;

#[allow(dead_code)]
fn find_entry_function(&self, name: &IdentStr) -> Option<MoveFunction>;

fn new_move_struct_field(&self, def: &FieldDefinition) -> MoveStructField {
Expand Down
1 change: 1 addition & 0 deletions libmovevm/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use anyhow::anyhow;

/// Access to the VM's backend storage, i.e. the chain
pub trait Storage {
#[allow(dead_code)]
/// Returns Err on error.
/// Returns Ok(None) when key does not exist.
/// Returns Ok(Some(Vec<u8>)) when key exists.
Expand Down
Binary file modified precompile/binaries/stdlib/dex.mv
Binary file not shown.

0 comments on commit 81b0585

Please sign in to comment.