Skip to content

Commit

Permalink
restore tokenid changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex v committed Aug 24, 2024
1 parent 8e2c096 commit e028174
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/ctokens/tokenid.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#include <tinyformat.h>
#include <uint256.h>

const uint256 stakedCommitmentToken = uint256();
const uint64_t stakedCommitmentSubId = 1;

class TokenId
{
public:
Expand All @@ -21,11 +18,6 @@ class TokenId

TokenId(const uint256& t = uint256(), const uint64_t& i = std::numeric_limits<uint64_t>::max()) : token(t), subid(i) {}

static TokenId StakedCommitment()
{
return TokenId(stakedCommitmentToken, stakedCommitmentSubId);
}

void SetNull()
{
token = uint256();
Expand All @@ -34,12 +26,7 @@ class TokenId

bool IsNull() const { return token == uint256() && subid == std::numeric_limits<uint64_t>::max(); }

bool IsStakedCommitment() const
{
return token == stakedCommitmentToken && subid == stakedCommitmentSubId;
}

std::string ToString() const { return strprintf("%s%s", token.ToString(), strprintf("#%d", subid)); }
std::string ToString() const { return strprintf("%s%s", token.ToString(), subid == std::numeric_limits<uint64_t>::max() ? "" : strprintf("#%d", subid)); }

friend bool operator==(const TokenId& a, const TokenId& b) { return a.token == b.token && a.subid == b.subid; }

Expand Down

0 comments on commit e028174

Please sign in to comment.