Skip to content
Snippets Groups Projects
Commit c80819c7 authored by inso's avatar inso
Browse files

Make difference between current and last ud

parent db3d7c84
No related branches found
No related tags found
No related merge requests found
...@@ -45,11 +45,13 @@ class Blockchain: ...@@ -45,11 +45,13 @@ class Blockchain:
# block number and hash # block number and hash
current_buid = attr.ib(convert=block_uid, default=BlockUID.empty()) current_buid = attr.ib(convert=block_uid, default=BlockUID.empty())
# Number of members # Number of members
members_count = attr.ib(convert=int, default=0, cmp=False, hash=False) current_members_count = attr.ib(convert=int, default=0, cmp=False, hash=False)
# Current monetary mass in units # Current monetary mass in units
current_mass = attr.ib(convert=int, default=0, cmp=False, hash=False) current_mass = attr.ib(convert=int, default=0, cmp=False, hash=False)
# Median time in seconds # Median time in seconds
median_time = attr.ib(convert=int, default=0, cmp=False, hash=False) median_time = attr.ib(convert=int, default=0, cmp=False, hash=False)
# Last members count
last_members_count = attr.ib(convert=int, default=0, cmp=False, hash=False)
# Last UD amount in units (multiply by 10^base) # Last UD amount in units (multiply by 10^base)
last_ud = attr.ib(convert=int, default=0, cmp=False, hash=False) last_ud = attr.ib(convert=int, default=0, cmp=False, hash=False)
# Last UD base # Last UD base
......
...@@ -34,9 +34,10 @@ class BlockchainsRepo: ...@@ -34,9 +34,10 @@ class BlockchainsRepo:
where_fields = attr.astuple(blockchain, filter=attr.filters.include(*BlockchainsRepo._primary_keys)) where_fields = attr.astuple(blockchain, filter=attr.filters.include(*BlockchainsRepo._primary_keys))
self._conn.execute("""UPDATE blockchains SET self._conn.execute("""UPDATE blockchains SET
current_buid=?, current_buid=?,
members_count=?, current_members_count=?,
current_mass=?, current_mass=?,
median_time=?, median_time=?,
last_members_count=?,
last_ud=?, last_ud=?,
last_ud_base=?, last_ud_base=?,
last_ud_time=?, last_ud_time=?,
......
...@@ -35,9 +35,10 @@ CREATE TABLE IF NOT EXISTS blockchains ( ...@@ -35,9 +35,10 @@ CREATE TABLE IF NOT EXISTS blockchains (
blocks_rot INT, blocks_rot INT,
percent_rot FLOAT(1, 6), percent_rot FLOAT(1, 6),
current_buid INT, current_buid INT,
members_count INT, current_members_count INT,
current_mass INT, current_mass INT,
median_time INT, median_time INT,
last_members_count INT,
last_ud INT, last_ud INT,
last_ud_base INT, last_ud_base INT,
last_ud_time INT, last_ud_time INT,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment