Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix multiple bugs with fees & refactor #474
So I decided to tackle this guy! Took me quite a while to figure out the main problem :)
Main problem was:
In the desktop we already used the method
So basically if a network had different fees for a transaction type, we ignored it and just used the default value...
Ok I pushed my refactor of this method...let me quote the commit message what I did:
I highly recommend reviewing this PR commit by commit to the reviewer - since the last commit looks like a lot happened even though it didn't.
By the way, while refactoring I also detected an "anomaly" which I'm not sure is a bug or not:
@perryhoffman and reviewer
I like it, but I'd add some tests, to ensure that it isn't breaking anything before starting the manual review.
One possible improvement, would be creating a new service, something like
transactionCreator, to move code outside
About the "anomaly" I'll try to tell you later, after having the new changes.
I tried writing unit tests for the accountService...however I have no working base at all (and I also think there isn't any).
Note that I also get this bug for existing tests, for example:
Can anyone else confirm if tests work on his machine?
@Nasicus I haven't written any tests for the service methods yet. I was hoping they would be refactored first, it would make writing asserts much more manageable!
You're right though, there currently isn't a base spec file for the accounts service. I just gave it a shot on my local. It seems to work fine, with the addition of 1 mock you were missing
Can you double check that you have npm installed properly? And that the arkjs package exists inside the client
@Nasicus I've tried the last commit (with
About which kind of tests would I expect: I'd move those methods outside the
If you prefer, just create the service and fix the one that is failing, and I'll add more tests myself.
So after what feels like an enternity to set up the "base ground" for testing I'm finally done for the moment ;)
Check it out and let me know if you need more.
I will do some more tests (manual on darknet) and rebase my branch this evening.