Skip to content
Snippets Groups Projects
Commit f8f33b34 authored by Holger Nahrstaedt's avatar Holger Nahrstaedt
Browse files

Removed not used classes from bitshares

parent 160bb6f9
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,7 @@ from beemgraphenebase.types import ( ...@@ -13,8 +13,7 @@ from beemgraphenebase.types import (
Varint32, Int64, String, Bytes, Void, Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool, Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant, Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId, Map, Id
ObjectId as GPHObjectId
) )
from beemgraphenebase.objects import GrapheneObject, isArgsThisClass from beemgraphenebase.objects import GrapheneObject, isArgsThisClass
from .objecttypes import object_type from .objecttypes import object_type
...@@ -33,32 +32,6 @@ asset_precision = { ...@@ -33,32 +32,6 @@ asset_precision = {
} }
def AssetId(asset):
return ObjectId(asset, "asset")
def AccountId(asset):
return ObjectId(asset, "account")
class ObjectId(GPHObjectId):
""" Encodes object/protocol ids
"""
def __init__(self, object_str, type_verify=None):
if len(object_str.split(".")) == 3:
space, type, id = object_str.split(".")
self.space = int(space)
self.type = int(type)
self.instance = Id(int(id))
self.Id = object_str
if type_verify:
if not object_type[type_verify] == int(type):
raise AssertionError("Object id does not match object type! "
"Excpected %d, got %d" % (object_type[type_verify], int(type)))
else:
raise Exception("Object id is invalid")
@python_2_unicode_compatible @python_2_unicode_compatible
class Amount(object): class Amount(object):
def __init__(self, d): def __init__(self, d):
...@@ -203,32 +176,6 @@ class Permission(GrapheneObject): ...@@ -203,32 +176,6 @@ class Permission(GrapheneObject):
])) ]))
class AccountOptions(GrapheneObject):
def __init__(self, *args, **kwargs):
# Allow for overwrite of prefix
prefix = kwargs.pop("prefix", default_prefix)
if isArgsThisClass(self, args):
self.data = args[0].data
else:
if len(args) == 1 and len(kwargs) == 0:
kwargs = args[0]
# remove dublicates
kwargs["votes"] = list(set(kwargs["votes"]))
# Sort votes
kwargs["votes"] = sorted(
kwargs["votes"],
key=lambda x: float(x.split(":")[1]),
)
super(AccountOptions, self).__init__(OrderedDict([
('memo_key', PublicKey(kwargs["memo_key"], prefix=prefix)),
('voting_account', ObjectId(kwargs["voting_account"], "account")),
('num_witness', Uint16(kwargs["num_witness"])),
('num_committee', Uint16(kwargs["num_committee"])),
('votes', Array([VoteId(o) for o in kwargs["votes"]])),
]))
@python_2_unicode_compatible @python_2_unicode_compatible
class Extension(Array): class Extension(Array):
def __str__(self): def __str__(self):
......
...@@ -11,7 +11,7 @@ from beemgraphenebase.types import ( ...@@ -11,7 +11,7 @@ from beemgraphenebase.types import (
Varint32, Int64, String, Bytes, Void, Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool, Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant, Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId Map, Id
) )
from .objects import GrapheneObject, isArgsThisClass from .objects import GrapheneObject, isArgsThisClass
from beemgraphenebase.account import PublicKey from beemgraphenebase.account import PublicKey
...@@ -24,8 +24,6 @@ from .objects import ( ...@@ -24,8 +24,6 @@ from .objects import (
Price, Price,
WitnessProps, WitnessProps,
Permission, Permission,
AccountOptions,
ObjectId,
ExchangeRate, ExchangeRate,
Beneficiaries, Beneficiaries,
Beneficiary, Beneficiary,
......
...@@ -12,8 +12,7 @@ from beemgraphenebase.types import ( ...@@ -12,8 +12,7 @@ from beemgraphenebase.types import (
Varint32, Int64, String, Bytes, Void, Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool, Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant, Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId, ObjectId, Map, Id, JsonObj
JsonObj
) )
from .py23 import py23_bytes, bytes_types, integer_types, string_types from .py23 import py23_bytes, bytes_types, integer_types, string_types
from .chains import known_chains from .chains import known_chains
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment