Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
On a different topic @kevkevinpal can i do some refactoring of the handlers to make it more testable ? **if i get assigned this bounty** .
Mainly would keep all the handler functions behind a struct and inject httpClient to it, making it much more easier to replace it with mockClient at the test. Something like this handler.go.
In the future can create an interface for DB and inject it in the handler thereby making the handler unit much more testable.
Can use mockery to auto generate mocks to cover all scenario and inject the mocks in tests thereby reducing our error to create mock functions and all.
Mainly would keep all the handler functions behind a struct and inject httpClient to it, making it much more easier to replace it with mockClient at the test. Something like this handler.go.
In the future can create an interface for DB and inject it in the handler thereby making the handler unit much more testable. Can use mockery to auto generate mocks to cover all scenario and inject the mocks in tests thereby reducing our error to create mock functions and all.
Just a thought.
Originally posted by @wright-eric in https://github.com/stakwork/sphinx-tribes/issues/1208#issuecomment-1872173900