-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BREAKING] fix: XRP().to_amount now expects XRP instead of drops (#554)
* fix XRP.to_amount * update changelog * fix circular dependency * fix circular dependency * add comment * fix test * improve comment
- Loading branch information
Showing
3 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
from unittest import TestCase | ||
|
||
from xrpl.models.currencies import XRP | ||
from xrpl.utils import xrp_to_drops | ||
|
||
|
||
class TestXRP(TestCase): | ||
def test_to_dict(self): | ||
self.assertEqual(XRP().to_dict()["currency"], "XRP") | ||
|
||
def test_to_amount(self): | ||
amount = "12" | ||
issued_currency_amount = XRP().to_amount(amount) | ||
amount = 12 | ||
expected = xrp_to_drops(amount) | ||
result = XRP().to_amount(amount) | ||
|
||
self.assertEqual(issued_currency_amount, amount) | ||
self.assertEqual(result, expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters