Skip to content

Commit

Permalink
fix: updated primitives/avn-common (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-cholakov committed Feb 21, 2024
1 parent 690206c commit a49f08a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
32 changes: 18 additions & 14 deletions primitives/avn-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,38 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
derive_more = "0.99.2"
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
hex-literal = { version = "0.3.4", default-features = false }
hex-literal = { version = "0.4.1", default-features = false }
impl-trait-for-tuples = "0.2.2"
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }

serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = [
"derive",
] }
log = { version = "0.4.17", default-features = false }

libsecp256k1 = { version = "0.3.2", default-features = false, features = ["hmac"] }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", features = ["serde"]}
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }

libsecp256k1 = { version = "0.7.0", default-features = false, features = [
"hmac",
] }
sha3 = { version = "0.8", default-features = false }

[dev-dependencies]
byte-slice-cast = "1.2.1"
sha3 = {version = "0.8.2", default-features = false }
sha3 = { version = "0.8.2", default-features = false }

[features]
default = ["std"]
std = [
"serde",
"log/std",
"scale-info/std",
"codec/std",
"sp-core/std",
"sp-std/std",
"sp-io/std",
"sp-runtime/std",
"log/std",
"libsecp256k1/std",
"sha3/std"
"sha3/std",
]
6 changes: 3 additions & 3 deletions primitives/avn-common/src/eth_key_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use sp_core::{ecdsa, H512};

pub fn decompress_eth_public_key(
compressed_eth_public_key: ecdsa::Public,
) -> Result<H512, secp256k1::Error> {
let decompressed = secp256k1::PublicKey::parse_slice(
) -> Result<H512, libsecp256k1::Error> {
let decompressed = libsecp256k1::PublicKey::parse_slice(
&compressed_eth_public_key.0,
Some(secp256k1::PublicKeyFormat::Compressed),
Some(libsecp256k1::PublicKeyFormat::Compressed),
);
match decompressed {
Ok(public_key) => {
Expand Down
4 changes: 0 additions & 4 deletions primitives/avn-common/src/event_types.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::bounds::NftExternalRefBound;
use codec::{Decode, Encode, MaxEncodedLen};
use hex_literal::hex;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_core::{bounded::BoundedVec, H160, H256, H512, U256};
use sp_runtime::{scale_info::TypeInfo, traits::Member, DispatchResult};
use sp_std::{convert::TryInto, vec::Vec};
Expand Down Expand Up @@ -59,7 +57,6 @@ pub enum Error {
}

#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum ValidEvents {
AddedValidator,
Lifted,
Expand Down Expand Up @@ -618,7 +615,6 @@ impl Default for CheckResult {
}

#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
// Note: strictly speaking, different contracts can have events with the same signature, which would
// suggest that the contract should be part of the EventId.
// But the expected communication framework is that all these events are generated by contracts we
Expand Down

0 comments on commit a49f08a

Please sign in to comment.