citadel-tech / coinswap

Functioning, minimal-viable binaries and libraries to perform a trustless, p2p Maxwell-Belcher Coinswap Protocol
https://gist.github.com/chris-belcher/9144bd57a91c194e332fb5ca371d0964
Other
69 stars 44 forks source link

test: Unit test for calculate_bond_value in src/wallet/fidelity.rs #126

Closed sivasathyaseeelan closed 5 months ago

sivasathyaseeelan commented 5 months ago

Issue Description: This issue highlights the need for unit tests for calculate_bond_value in src/wallet/fidelity.rs file. Currently, calculate_bond_value in this file are untested, which could lead to potential issues in the future.

Objective: Write unit tests for the calculate_bond_value function in the src/wallet/fidelity.rs file.

Details:

Cover all calculate_bond_value with appropriate test cases. Ensure tests validate functionality, handle edge cases, and check error conditions. Integrate the tests into our existing test suite.

https://app.codecov.io/github/utxo-teleport/teleport-transactions/blob/master/src%2Fwallet%2Ffidelity.rs

sivasathyaseeelan commented 5 months ago

I will work on this issue. can anyone please assign me this issue?

rajarshimaitra commented 5 months ago

You cannot do a unit test for this function as it requires the rpc interface.

This and many other fidelity things should be tested via integration test as described here.. https://github.com/utxo-teleport/teleport-transactions/issues/97

@wthrajat took up that issue, But Rajat if you are not currently doing it maybe @sivasathyaseeelan can take it up?

wthrajat commented 5 months ago

As @rajarshimaitra mentioned, the parent issue is #97, this issue should be closed; @sivasathyaseeelan, if you want to do it, you can start working on it. Make sure you keep this in mind ; )

Think adversarially about how many ways people can cheat on fidelity or attack a Maker by modifying their fidelity.

I have #80 and #116 on my plate right now so feel free to work on #97.