Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

sdk/agent: add tests for happy path #225

Closed
leighmcculloch opened this issue Jul 30, 2021 · 0 comments · Fixed by #255
Closed

sdk/agent: add tests for happy path #225

leighmcculloch opened this issue Jul 30, 2021 · 0 comments · Fixed by #255
Assignees

Comments

@leighmcculloch
Copy link
Contributor

The agent was ported into the SDK out of an example and its functionality was driven by the example. If this code is to be lifted from example and into library code we should test it without the example by writing tests that use it.

@leighmcculloch leighmcculloch self-assigned this Aug 25, 2021
@leighmcculloch leighmcculloch linked a pull request Aug 26, 2021 that will close this issue
leighmcculloch added a commit that referenced this issue Aug 26, 2021
Update escrow account on-network balance that is cached in the channel whenever sending or receiving a payment that looks like it exceeds the last known available balance.

If a payment is exceeding the balance the only option we have is to stop and close the channel, so we may as check the network to see if the balance is updated which might allow the payment to succeed.

I think the usefulness of this balance update is questionable given we will soon have the agent using the state's ingestion to update the balances, but in the interim I need to update the balances one way or another to get tests I'm writing for #225 and #226 to pass. This seems like a good temporary hold over and something we can evaluate in the near future if we still need.

I removed the TODO to remove the existing check because it's a little fuzzy to me if we really want to do that.

There's no test in this PR for this change because I'm writing tests for the agent in #242 which incorporates a few things that make writing tests for the agent much more straight forward.
@leighmcculloch leighmcculloch changed the title sdk/agent: add tests for common usage patterns sdk/agent: add tests for happy path Aug 26, 2021
leighmcculloch added a commit that referenced this issue Aug 27, 2021
Add a first happy path test that exercises two agents that are connected to each other and successfully open, pay, and close.

The agent code was ported over from the console example. The console example was really written to be throw away code, but the agent code within it was well formed enough to be something to build on. It's important we add tests early for the agent before we build too much more into it. This is a first step to closing #225.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant