Skip to content

Commit

Permalink
Use crates.io registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan authored and Ivan committed Aug 31, 2023
1 parent 65a1d05 commit 8114dd4
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 28 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"]
obce-macro = { path = "macro", default-features = false }

# Substrate deps
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
sp-std = { version = "9.0.0", default-features = false, optional = true }
sp-runtime = { version = "25.0.0", default-features = false, optional = true }
sp-core = { version = "22.0.0", default-features = false, optional = true }
frame-support = { version = "22.0.0", default-features = false, optional = true }
frame-system = { version = "22.0.0", default-features = false, optional = true }
pallet-contracts = { version = "21.0.0", default-features = false, optional = true }

# Ink deps
ink = { version = "4.2.0", default-features = false, optional = true }
ink_engine = { version = "4.2.0", default-features = false, optional = true }

[dev-dependencies]
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, features = ["std"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, features = ["std"] }
frame-support = { version = "22.0.0", default-features = false, features = ["std"] }
frame-system = { version = "22.0.0", default-features = false, features = ["std"] }
ink = { version = "4.2.0", default-features = false, features = ["std"] }
trybuild = "1.0"

Expand Down
2 changes: 1 addition & 1 deletion codegen/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn generate(input: TokenStream) -> Result<TokenStream, Error> {
// whether a user wants to get an identifier of a chain extension
// or a chain extension method itself.
_ => {
return Err(format_err_spanned!(
Err(format_err_spanned!(
path,
"id macro supports only two-segment paths (ChainExtension, ChainExtension::method)"
))
Expand Down
4 changes: 1 addition & 3 deletions codegen/src/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,7 @@ fn handle_weight_attribute<'a, I: IntoIterator<Item = &'a NestedMeta>>(
return None
};

let Some(ident) = list.path.get_ident() else {
return None
};
let ident = list.path.get_ident()?;

(ident == "weight").then_some((&list.nested, ident))
});
Expand Down
6 changes: 3 additions & 3 deletions codegen/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where
{
fn find_by_name(self, name: &str) -> Option<(LitOrPath<'a>, &'a Ident)> {
self.into_iter().find_map(|attr| {
match attr.borrow() {
match attr {
NestedMeta::Meta(Meta::NameValue(value)) => {
if let Some(ident) = value.path.get_ident() {
(ident == name).then_some((LitOrPath::Lit(&value.lit), ident))
Expand Down Expand Up @@ -145,7 +145,7 @@ impl<'a> InputBindings<'a> {
/// Iterate over "special" bindings identifiers.
///
/// For example, it converts `(one: u32, two: u32)` into `(__ink_binding_0, __ink_binding_1)`.
pub fn iter_call_params(&self) -> impl Iterator<Item = Ident> + ExactSizeIterator + '_ {
pub fn iter_call_params(&self) -> impl ExactSizeIterator<Item = Ident> + '_ {
self.bindings
.iter()
.enumerate()
Expand All @@ -155,7 +155,7 @@ impl<'a> InputBindings<'a> {
/// Iterate over raw bindings patterns.
///
/// The provided iterator makes no conversions from the inner values stored inside [`InputBindings`].
pub fn iter_raw_call_params(&self) -> impl Iterator<Item = &Pat> + ExactSizeIterator + '_ {
pub fn iter_raw_call_params(&self) -> impl ExactSizeIterator<Item = &Pat> + '_ {
self.bindings.iter().map(|pat| &*pat.pat)
}

Expand Down
2 changes: 1 addition & 1 deletion examples/rand-extension/chain-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"] }

ink = { version = "4.2.0", default-features = false, optional = true }

pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true }
pallet-insecure-randomness-collective-flip = { version = "10.0.0", default-features = false, optional = true }

[features]
default = ["std"]
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

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

1 change: 1 addition & 0 deletions tests/ui/ink/mock/fail_random_trait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ error[E0277]: the trait bound `(dyn Trait + 'static): ExtensionDescription` is n
| ^^^^^^^^^^^^^ the trait `ExtensionDescription` is not implemented for `(dyn Trait + 'static)`
|
= help: see issue #48214
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
= note: this error originates in the attribute macro `obce::mock` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 8114dd4

Please sign in to comment.