Refactor cart to use "entries" instead of "items"

This commit is contained in:
Juerd Waalboer 2019-11-04 21:53:07 +01:00
parent ed03f09414
commit 5a7a7184dd
3 changed files with 95 additions and 85 deletions

View file

@ -156,13 +156,13 @@ sub sanity_check {
# not required. However, in a transaction with contras, one should at least
# not try to issue money that does not exist.
return 1 if $self->{force};
return 1 if $self->{FORCE};
my @contras = $self->contras or return 1;
my $amount = List::Util::sum(map $_->{amount}, $self, @contras);
if ($amount >= 0.005) { # meh, floats
$self->{force} = 1;
$self->{FORCE} = 1;
croak join("\n",
"BUG! (probably in $self->{caller})",
"This adds up to creating money that does not exist:",