Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions crates/cargo-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ scale-info = "2.8.0"
subxt = "0.29.0"
hex = "0.4.3"
jsonrpsee = { version = "0.18.2", features = ["ws-client"] }
libsecp256k1 = { version = "0.7", default-features = false , features = [ "hmac" ] }
sha3 = "0.10.8"
sp-io = "23.0.0"
impl-serde = "0.4.0"

[build-dependencies]
anyhow = "1.0.71"
Expand Down
4 changes: 2 additions & 2 deletions crates/cargo-contract/src/cmd/extrinsics/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::{
Balance,
CodeHash,
},
DEFAULT_KEY_COL_WIDTH,
DEFAULT_KEY_COL_WIDTH, account::AccountId20,
};
use anyhow::{
anyhow,
Expand Down Expand Up @@ -329,7 +329,7 @@ impl Exec {
&self,
result: &ExtrinsicEvents<DefaultConfig>,
code_hash: Option<CodeHash>,
contract_address: subxt::utils::AccountId32,
contract_address: AccountId20,
token_metadata: &TokenMetadata,
) -> Result<(), ErrorVariant> {
let events = DisplayEvents::from_events(
Expand Down
3 changes: 2 additions & 1 deletion crates/cargo-contract/src/cmd/extrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ pub use contract_transcode::ContractMessageTranscoder;
pub use error::ErrorVariant;
pub use instantiate::InstantiateCommand;
pub use remove::RemoveCommand;
pub use subxt::PolkadotConfig as DefaultConfig;
// pub use subxt::PolkadotConfig as DefaultConfig;
pub use super::DefaultConfig;
pub use upload::UploadCommand;

type PairSigner = tx::PairSigner<DefaultConfig, sr25519::Pair>;
Expand Down
21 changes: 19 additions & 2 deletions crates/cargo-contract/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub mod encode;
pub mod info;
pub mod runtime_api;

use crate::account;

pub(crate) use self::{
build::{
BuildCommand,
Expand All @@ -40,10 +42,25 @@ pub(crate) use self::extrinsics::{

use subxt::{
Config,
OnlineClient,
OnlineClient, SubstrateConfig,
};
use subxt::config::substrate::SubstrateExtrinsicParams;

// pub use subxt::PolkadotConfig as DefaultConfig;
pub use AcademyPowConfig as DefaultConfig;

pub enum AcademyPowConfig{}
impl subxt::Config for DefaultConfig {
type Index = <SubstrateConfig as Config>::Index;
type Hash = <SubstrateConfig as Config>::Hash;
type AccountId = account::AccountId20;
type Address = account::AccountId20;
type Signature = account::EthereumSignature;
type Hasher = <SubstrateConfig as Config>::Hasher;
type Header = <SubstrateConfig as Config>::Header;
type ExtrinsicParams = SubstrateExtrinsicParams<Self>;
}

pub use subxt::PolkadotConfig as DefaultConfig;
type Client = OnlineClient<DefaultConfig>;
type Balance = u128;
type CodeHash = <DefaultConfig as Config>::Hash;
1 change: 1 addition & 0 deletions crates/cargo-contract/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#![deny(unused_crate_dependencies)]

mod cmd;
mod account;

use self::cmd::{
BuildCommand,
Expand Down
6 changes: 6 additions & 0 deletions crates/transcode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ serde_json = "1.0.99"
thiserror = "1.0.40"
strsim = "0.10.0"

libsecp256k1 = { version = "0.7", default-features = false , features = [ "hmac" ] }
sha3 = "0.10.8"
sp-io = "23.0.0"
impl-serde = "0.4.0"
sp-runtime = "24.0.0"

[dev-dependencies]
assert_matches = "1.5.0"
ink = "4.2.0"
Expand Down
Loading