mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-05 22:53:11 +00:00
cl: reverse partial tx balance (inputs are neg, outputs are pos)
This commit is contained in:
parent
2ea4a4d351
commit
33ee6dea8c
@ -108,7 +108,7 @@ impl PartialTx {
|
||||
let in_sum: ExtendedPoint = self.inputs.iter().map(|i| i.balance).sum();
|
||||
let out_sum: ExtendedPoint = self.outputs.iter().map(|o| o.balance).sum();
|
||||
|
||||
in_sum - out_sum
|
||||
out_sum - in_sum
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,9 +164,9 @@ mod test {
|
||||
|
||||
assert_eq!(
|
||||
ptx.balance(),
|
||||
crate::balance::balance(10, "NMO", nmo_10.balance_blinding)
|
||||
+ crate::balance::balance(23, "ETH", eth_23.balance_blinding)
|
||||
- crate::balance::balance(4840, "CRV", crv_4840.balance_blinding)
|
||||
crate::balance::balance(4840, "CRV", crv_4840.balance_blinding)
|
||||
- (crate::balance::balance(10, "NMO", nmo_10.balance_blinding)
|
||||
+ crate::balance::balance(23, "ETH", eth_23.balance_blinding))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user