Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename burst to signum #788

Merged
merged 9 commits into from
Jan 29, 2024
2 changes: 1 addition & 1 deletion html/ui/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
body {
font-family: 'Montserrat', sans-serif;
height: 100vh;
background-color: var(--burst-blue);
background-color: var(--signum-blue);
overflow: hidden;
color: #fefefe;
}
Expand Down
2 changes: 1 addition & 1 deletion html/ui/assets/vars.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:root {
--burst-blue: #00579d
--signum-blue: #00579d
}
52 changes: 26 additions & 26 deletions src/brs/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import brs.crypto.Crypto;
import brs.crypto.EncryptedData;
import brs.db.BurstKey;
import brs.db.SignumKey;
import brs.db.VersionedBatchEntityTable;
import brs.util.Convert;

Expand All @@ -17,7 +17,7 @@ public class Account {
private static final Logger logger = Logger.getLogger(Account.class.getSimpleName());

public final long id;
public final BurstKey nxtKey;
public final SignumKey nxtKey;
private final int creationHeight;
private byte[] publicKey;
private int keyHeight;
Expand All @@ -28,15 +28,15 @@ public class Account {

public static class Balance {
public final long id;
public final BurstKey nxtKey;
public final SignumKey nxtKey;

protected long balanceNQT;
protected long unconfirmedBalanceNQT;
protected long forgedBalanceNQT;

public Balance(long id) {
this.id = id;
this.nxtKey = accountBurstKeyFactory().newKey(this.id);
this.nxtKey = accountSignumKeyFactory().newKey(this.id);
}

public void setForgedBalanceNQT(long forgedBalanceNQT) {
Expand Down Expand Up @@ -106,24 +106,24 @@ public enum Event {
public static class AccountAsset {
public final long accountId;
public final long assetId;
public final BurstKey burstKey;
public final SignumKey signumKey;
private long quantityQNT;
private long unconfirmedQuantityQNT;
private boolean isTreasury;

protected AccountAsset(long accountId, long assetId, long quantityQNT, long unconfirmedQuantityQNT, BurstKey burstKey) {
protected AccountAsset(long accountId, long assetId, long quantityQNT, long unconfirmedQuantityQNT, SignumKey signumKey) {
this.accountId = accountId;
this.assetId = assetId;
this.quantityQNT = quantityQNT;
this.unconfirmedQuantityQNT = unconfirmedQuantityQNT;
this.burstKey = burstKey;
this.signumKey = signumKey;
this.isTreasury = false;
}

public AccountAsset(BurstKey burstKey, long accountId, long assetId, long quantityQNT, long unconfirmedQuantityQNT) {
public AccountAsset(SignumKey signumKey, long accountId, long assetId, long quantityQNT, long unconfirmedQuantityQNT) {
this.accountId = accountId;
this.assetId = assetId;
this.burstKey = burstKey;
this.signumKey = signumKey;
this.quantityQNT = quantityQNT;
this.unconfirmedQuantityQNT = unconfirmedQuantityQNT;
this.isTreasury = false;
Expand Down Expand Up @@ -184,14 +184,14 @@ public static class RewardRecipientAssignment {
private Long prevRecipientId;
private Long recipientId;
private int fromHeight;
public final BurstKey burstKey;
public final SignumKey signumKey;

public RewardRecipientAssignment(Long accountId, Long prevRecipientId, Long recipientId, int fromHeight, BurstKey burstKey) {
public RewardRecipientAssignment(Long accountId, Long prevRecipientId, Long recipientId, int fromHeight, SignumKey signumKey) {
this.accountId = accountId;
this.prevRecipientId = prevRecipientId;
this.recipientId = recipientId;
this.fromHeight = fromHeight;
this.burstKey = burstKey;
this.signumKey = signumKey;
}

public long getAccountId() {
Expand Down Expand Up @@ -224,32 +224,32 @@ static class DoubleSpendingException extends RuntimeException {

}

private static BurstKey.LongKeyFactory<Account> accountBurstKeyFactory() {
return Burst.getStores().getAccountStore().getAccountKeyFactory();
private static SignumKey.LongKeyFactory<Account> accountSignumKeyFactory() {
return Signum.getStores().getAccountStore().getAccountKeyFactory();
}

private static BurstKey.LongKeyFactory<Account.Balance> accountBalanceBurstKeyFactory() {
return Burst.getStores().getAccountStore().getAccountBalanceKeyFactory();
private static SignumKey.LongKeyFactory<Account.Balance> accountBalanceSignumKeyFactory() {
return Signum.getStores().getAccountStore().getAccountBalanceKeyFactory();
}

private static VersionedBatchEntityTable<Account> accountTable() {
return Burst.getStores().getAccountStore().getAccountTable();
return Signum.getStores().getAccountStore().getAccountTable();
}

private static VersionedBatchEntityTable<Account.Balance> accountBalanceTable() {
return Burst.getStores().getAccountStore().getAccountBalanceTable();
return Signum.getStores().getAccountStore().getAccountBalanceTable();
}

public static Account getAccount(long id) {
return id == 0 ? null : accountTable().get(accountBurstKeyFactory().newKey(id));
return id == 0 ? null : accountTable().get(accountSignumKeyFactory().newKey(id));
}

public static Account.Balance getAccountBalance(long id) {
return id == 0 ? null : accountBalanceTable().get(accountBalanceBurstKeyFactory().newKey(id));
return id == 0 ? null : accountBalanceTable().get(accountBalanceSignumKeyFactory().newKey(id));
}

public static Account.AccountAsset getAccountAssetBalance(long id, long assetId) {
return Burst.getStores().getAccountStore().getAccountAsset(id, assetId);
return Signum.getStores().getAccountStore().getAccountAsset(id, assetId);
}

public static long getId(byte[] publicKey) {
Expand All @@ -271,16 +271,16 @@ public Account(long id) {
logger.log(Level.INFO, "CRITICAL ERROR: Reed-Solomon encoding fails for {0}", id);
}
this.id = id;
this.nxtKey = accountBurstKeyFactory().newKey(this.id);
this.creationHeight = Burst.getBlockchain().getHeight();
this.nxtKey = accountSignumKeyFactory().newKey(this.id);
this.creationHeight = Signum.getBlockchain().getHeight();
}

protected Account(long id, BurstKey burstKey, int creationHeight) {
protected Account(long id, SignumKey signumKey, int creationHeight) {
if (id != Crypto.rsDecode(Crypto.rsEncode(id))) {
logger.log(Level.INFO, "CRITICAL ERROR: Reed-Solomon encoding fails for {0}", id);
}
this.id = id;
this.nxtKey = burstKey;
this.nxtKey = signumKey;
this.creationHeight = creationHeight;
}

Expand Down Expand Up @@ -353,7 +353,7 @@ public byte[] decryptFrom(EncryptedData encryptedData, String recipientSecretPhr
// or
// this.publicKey is already set to an array equal to key
public boolean setOrVerify(byte[] key, int height) {
return Burst.getStores().getAccountStore().setOrVerify(this, key, height);
return Signum.getStores().getAccountStore().setOrVerify(this, key, height);
}

public void apply(byte[] key, int height) {
Expand Down
18 changes: 9 additions & 9 deletions src/brs/Alias.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package brs;

import brs.db.BurstKey;
import brs.db.SignumKey;

public class Alias {

private long accountId;
private final long id;
public final BurstKey dbKey;
public final SignumKey dbKey;
private final String aliasName;
private final Long tld;
private String aliasURI;
private int timestamp;

private Alias(BurstKey dbKey, long id, long accountId, String aliasName, Long tld, String aliasURI, int timestamp) {
private Alias(SignumKey dbKey, long id, long accountId, String aliasName, Long tld, String aliasURI, int timestamp) {
this.id = id;
this.dbKey = dbKey;
this.accountId = accountId;
Expand All @@ -22,7 +22,7 @@ private Alias(BurstKey dbKey, long id, long accountId, String aliasName, Long tl
this.timestamp = timestamp;
}

protected Alias(long id, long accountId, String aliasName, Long tld, String aliasURI, int timestamp, BurstKey dbKey) {
protected Alias(long id, long accountId, String aliasName, Long tld, String aliasURI, int timestamp, SignumKey dbKey) {
this.id = id;
this.dbKey = dbKey;
this.accountId = accountId;
Expand All @@ -32,12 +32,12 @@ protected Alias(long id, long accountId, String aliasName, Long tld, String alia
this.timestamp = timestamp;
}

public Alias(long aliasId, BurstKey dbKey, Transaction transaction, Attachment.MessagingAliasAssignment attachment) {
public Alias(long aliasId, SignumKey dbKey, Transaction transaction, Attachment.MessagingAliasAssignment attachment) {
this(dbKey, aliasId, transaction.getSenderId(), attachment.getAliasName(), attachment.getTLD(), attachment.getAliasURI(),
transaction.getBlockTimestamp());
}

public Alias(long aliasId, BurstKey dbKey, Transaction transaction, Attachment.MessagingTLDAssignment attachment) {
public Alias(long aliasId, SignumKey dbKey, Transaction transaction, Attachment.MessagingTLDAssignment attachment) {
this(dbKey, aliasId, transaction == null ? 0L : transaction.getSenderId(), attachment.getTLDName(), null, "",
transaction == null ? 0 : transaction.getBlockTimestamp());
}
Expand Down Expand Up @@ -83,16 +83,16 @@ public static class Offer {
private long priceNQT;
private long buyerId;
private final long aliasId;
public final BurstKey dbKey;
public final SignumKey dbKey;

public Offer(BurstKey dbKey, long aliasId, long priceNQT, long buyerId) {
public Offer(SignumKey dbKey, long aliasId, long priceNQT, long buyerId) {
this.dbKey = dbKey;
this.priceNQT = priceNQT;
this.buyerId = buyerId;
this.aliasId = aliasId;
}

protected Offer(long aliasId, long priceNQT, long buyerId, BurstKey nxtKey) {
protected Offer(long aliasId, long priceNQT, long buyerId, SignumKey nxtKey) {
this.priceNQT = priceNQT;
this.buyerId = buyerId;
this.aliasId = aliasId;
Expand Down
Loading