SHA256
Исправить регистр ключей и ответные связи
This commit is contained in:
+8
-3
@@ -1,6 +1,7 @@
|
||||
package shine.db.entities;
|
||||
|
||||
import java.util.Base64;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Агрегатная сущность текущего состояния блокчейна.
|
||||
@@ -42,14 +43,18 @@ public final class BlockchainStateEntry {
|
||||
if (dash <= 0 || blockchainName.length()-dash-1 != 3) throw new IllegalArgumentException("Bad blockchainName: "+blockchainName);
|
||||
int parsedFork=Integer.parseInt(blockchainName.substring(dash+1));
|
||||
if (parsedFork < 1 || parsedFork > 999) throw new IllegalArgumentException("forkNumber must be 1..999");
|
||||
this.login=blockchainName.substring(0,dash);
|
||||
// Runtime-ключ цепочки всегда нормализован. Исходное написание
|
||||
// зарегистрированного login хранится отдельно в user_identity_current.
|
||||
this.login=blockchainName.substring(0,dash).trim().toLowerCase(Locale.ROOT);
|
||||
this.forkNumber=parsedFork;
|
||||
}
|
||||
public int getForkNumber() { return forkNumber; }
|
||||
public void setForkNumber(int forkNumber) { if (forkNumber < 1 || forkNumber > 999) throw new IllegalArgumentException("forkNumber must be 1..999"); this.forkNumber = forkNumber; }
|
||||
|
||||
public String getLogin() { return login; }
|
||||
public void setLogin(String login) { this.login = login; }
|
||||
public void setLogin(String login) {
|
||||
this.login = login == null ? null : login.trim().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
public String getBlockchainKey() { return blockchainKey; }
|
||||
public void setBlockchainKey(String blockchainKey) { this.blockchainKey = blockchainKey; }
|
||||
@@ -80,4 +85,4 @@ public final class BlockchainStateEntry {
|
||||
|
||||
public long getUpdatedAtMs() { return updatedAtMs; }
|
||||
public void setUpdatedAtMs(long updatedAtMs) { this.updatedAtMs = updatedAtMs; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user