Changes to rm-refactor-overloaded-assets-operators
Merged
requested to merge mzebrak/rm-refactor-overloaded-assets-operators into rm-refactor-overloaded-assets-operators
Compare changes
- Mateusz Żebrak authored
+ 67
− 67
@@ -21,38 +21,28 @@ class AssetBase(acp.Abstract):
@@ -21,38 +21,28 @@ class AssetBase(acp.Abstract):
@@ -67,33 +57,40 @@ class AssetBase(acp.Abstract):
@@ -67,33 +57,40 @@ class AssetBase(acp.Abstract):
raise ParseError(f"Asset dict keys differ: {other.keys()}, when expected {cls.__template().keys()}.")
raise ParseError(f"Asset dict precision differ: `{other['precision']}`, when expected `{cls.precision}`.")
raise TypeError(f"Can't {error_detail} assets with different tokens: `{self.token}` and `{other.token}`.")
@@ -117,16 +114,19 @@ class AssetBase(acp.Abstract):
@@ -117,16 +114,19 @@ class AssetBase(acp.Abstract):
@@ -155,6 +155,23 @@ class Asset:
@@ -155,6 +155,23 @@ class Asset:
@@ -183,20 +200,3 @@ class Asset:
@@ -183,20 +200,3 @@ class Asset:
def from_(cls, data: Union[str, dict], *, treat_dict_as_testnet_currencies: bool = True) -> AssetBase:
This function allows you to convert an asset from string or JSON format to the appropriate object of Asset type.
By default, treat_dict_as_testnet_currencies parameter is set to True. As a result, an Asset object will be