From d852d82fbeb5191a62400996317d57db108629a9 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Wed, 27 Mar 2024 17:29:02 +0100 Subject: [PATCH] update to match the refactored interfaces --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- cli/src/command.rs | 16 ---------------- src/pay.rs | 9 ++++----- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f9de93..15bb20c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1594,7 +1594,7 @@ dependencies = [ [[package]] name = "rgb-invoice" version = "0.11.0-beta.4" -source = "git+https://github.com/RGB-WG/rgb-std?branch=dups#f793a738ee1d1ce10f1a0fae4e1cd3d8189f074e" +source = "git+https://github.com/RGB-WG/rgb-std?branch=iface#6bb5e9f21b5ee2991600fde18d691de4f61ea615" dependencies = [ "amplify", "baid58", @@ -1664,7 +1664,7 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.4" -source = "git+https://github.com/RGB-WG/rgb-std?branch=dups#f793a738ee1d1ce10f1a0fae4e1cd3d8189f074e" +source = "git+https://github.com/RGB-WG/rgb-std?branch=iface#6bb5e9f21b5ee2991600fde18d691de4f61ea615" dependencies = [ "amplify", "ascii-armor", diff --git a/Cargo.toml b/Cargo.toml index e7b3966..c604021 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,4 +96,4 @@ serde = ["serde_crate", "serde_with", "serde_yaml", "bp-std/serde", "bp-wallet/s features = ["all"] [patch.crates-io] -rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "dups" } +rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "iface" } diff --git a/cli/src/command.rs b/cli/src/command.rs index d43e666..2978a31 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -552,14 +552,6 @@ impl Exec for RgbArgs { let name = name .as_str() .expect("invalid YAML: global name must be a string"); - let name = iface - .genesis - .global - .iter() - .find(|(n, _)| n.as_str() == name) - .and_then(|(_, spec)| spec.name.as_ref()) - .map(FieldName::as_str) - .unwrap_or(name); let state_type = iface_impl .global_state .iter() @@ -596,14 +588,6 @@ impl Exec for RgbArgs { let name = name .as_str() .expect("invalid YAML: assignments name must be a string"); - let name = iface - .genesis - .assignments - .iter() - .find(|(n, _)| n.as_str() == name) - .and_then(|(_, spec)| spec.name.as_ref()) - .map(FieldName::as_str) - .unwrap_or(name); let state_type = iface_impl .assignments .iter() diff --git a/src/pay.rs b/src/pay.rs index 43e039a..c6f8af0 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -192,11 +192,10 @@ impl Runtime { .assignment .as_ref() .or_else(|| { - iface.transitions.get(operation).and_then(|t| { - t.default_assignment - .as_ref() - .and_then(|f| t.assignments.get(f).and_then(|arg| (&arg.name).into())) - }) + iface + .transitions + .get(operation) + .and_then(|t| t.default_assignment.as_ref()) }) .cloned() .ok_or(CompositionError::NoAssignment)?;