Skip to content

Commit

Permalink
Simplify signatures of calls using only payment id
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod committed Feb 14, 2024
1 parent fbea3ef commit b94ee4c
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 321 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.

8 changes: 7 additions & 1 deletion common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
bs58 = { version = "0.5.0", default-features = false }
wasm-bindgen = { version = "0.2.87", optional = true }

pallet-payments = { workspace = true, optional = true }
frame-support = { workspace = true, optional = true }
parity-scale-codec = { workspace = true, optional = true }
scale-info = { workspace = true, optional = true }
Expand All @@ -19,4 +20,9 @@ default = ["runtime"]
alloc = []
js = ["alloc", "wasm-bindgen"]
nightly = []
runtime = ["dep:frame-support", "dep:parity-scale-codec", "dep:scale-info"]
runtime = [
"dep:frame-support",
"dep:parity-scale-codec",
"dep:scale-info",
"dep:pallet-payments",
]
11 changes: 10 additions & 1 deletion common/src/payment_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ use wasm_bindgen::prelude::*;

/// A compact identifier for payment
#[cfg_attr(feature = "js", wasm_bindgen)]
#[derive(Debug, Default, Clone, Copy, PartialEq)]
#[derive(Debug, Default, Clone, Eq, Copy, PartialEq)]
#[cfg_attr(
feature = "runtime",
derive(
parity_scale_codec::Encode,
parity_scale_codec::Decode,
parity_scale_codec::MaxEncodedLen,
scale_info::TypeInfo,
)
)]
#[repr(C)]
pub struct PaymentId {
prefix: [u8; 2],
Expand Down
Loading

0 comments on commit b94ee4c

Please sign in to comment.