Skip to content

Commit

Permalink
Merge pull request #68 from crisdut/fix/select-assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky authored Dec 23, 2023
2 parents 62b5009 + 721b55c commit 79ba1b6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,20 @@ impl Runtime {
.as_ref()
.or(iface.default_operation.as_ref())
.ok_or(CompositionError::NoOperation)?;

let assignment_name = invoice
.assignment
.as_ref()
.or_else(|| {
iface
.transitions
.get(operation)
.and_then(|t| t.default_assignment.as_ref())
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()))
})
})
.cloned()
.ok_or(CompositionError::NoAssignment)?;

let outputs = match invoice.owned_state {
InvoiceState::Amount(amount) => {
let mut state = contract
Expand Down

0 comments on commit 79ba1b6

Please sign in to comment.