Skip to content

Commit

Permalink
fix: minor fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht committed Dec 13, 2024
1 parent 1f95acb commit 2a09b0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions crates/pop-cli/src/commands/up/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,6 @@ impl From<UpContractCommand> for UpOpts {
}
}

/// Checks if a contract has been built by verifying the existence of the build directory and the
/// <name>.contract file.
///
/// # Arguments
/// * `path` - An optional path to the project directory. If no path is provided, the current
/// directory is used.
pub fn has_contract_been_built(path: Option<&Path>) -> bool {
let project_path = path.unwrap_or_else(|| Path::new("./"));
let manifest = match from_path(Some(project_path)) {
Ok(manifest) => manifest,
Err(_) => return false,
};
let contract_name = manifest.package().name();
project_path.join("target/ink").exists() &&
project_path.join(format!("target/ink/{}.contract", contract_name)).exists()
}

fn display_contract_info(spinner: &ProgressBar, address: String, code_hash: Option<String>) {
spinner.stop(format!(
"Contract deployed and instantiated:\n{}",
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/wallet_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl TransactionData {
pub fn new(chain_rpc: String, call_data: Vec<u8>) -> Self {
Self { chain_rpc, call_data }
}
#[allow(dead_code)]
pub fn call_data(&self) -> Vec<u8> {
self.call_data.clone()
}
Expand Down
4 changes: 3 additions & 1 deletion crates/pop-contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ sp-core.workspace = true
sp-weights.workspace = true
strum.workspace = true
strum_macros.workspace = true
subxt-signer.workspace = true
subxt.workspace = true

# cargo-contracts
contract-build.workspace = true
contract-extrinsics.workspace = true
contract-transcode.workspace = true
contract-transcode.workspace = true
scale-info.workspace = true
# pop
pop-common = { path = "../pop-common", version = "0.5.0" }
Expand Down
5 changes: 2 additions & 3 deletions crates/pop-contracts/src/up.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ use pop_common::{create_signer, DefaultConfig, Keypair};
use sp_core::{bytes::from_hex, Bytes};
use sp_weights::Weight;
use std::{
fmt::{format, Write},
fmt::Write,
path::{Path, PathBuf},
};
use subxt::{
blocks::ExtrinsicEvents,
tx::{Payload, SubmittableExtrinsic},
Config, PolkadotConfig as DefaultConfig, SubstrateConfig,
Config, SubstrateConfig,
};
use subxt_signer::sr25519::Keypair;

/// Attributes for the `up` command
#[derive(Clone, Debug, PartialEq)]
Expand Down

0 comments on commit 2a09b0a

Please sign in to comment.