SHA256
Полностью поддерживает английский язык
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
const SNAPSHOT_STORAGE_KEY = 'shine-ui-blockchain-snapshot-v1';
|
||||
|
||||
function normalizeLogin(login) {
|
||||
@@ -69,11 +70,11 @@ export async function buildBlockchainSnapshotFile({
|
||||
const cleanLogin = normalizeLogin(login);
|
||||
const cleanBlockchainName = String(blockchainName || '').trim();
|
||||
const maxBlockNumber = Number(lastBlockNumber);
|
||||
if (!authService?.ws?.request) throw new Error('Сервис сервера недоступен.');
|
||||
if (!cleanLogin) throw new Error('Не указан логин.');
|
||||
if (!cleanBlockchainName) throw new Error('Не указано имя блокчейна.');
|
||||
if (!authService?.ws?.request) throw new Error(t('remaining.blockchain_snapshot.server_service_unavailable'));
|
||||
if (!cleanLogin) throw new Error(t('remaining.blockchain_snapshot.login_missing'));
|
||||
if (!cleanBlockchainName) throw new Error(t('remaining.blockchain_snapshot.blockchain_name_missing'));
|
||||
if (!Number.isFinite(maxBlockNumber) || maxBlockNumber < 0) {
|
||||
throw new Error('На сервере нет блоков для слепка.');
|
||||
throw new Error(t('remaining.blockchain_snapshot.no_blocks_available_on_the_server_for_a_snapshot'));
|
||||
}
|
||||
|
||||
const parts = [];
|
||||
@@ -84,7 +85,7 @@ export async function buildBlockchainSnapshotFile({
|
||||
blockNumber,
|
||||
});
|
||||
if (response?.status !== 200) {
|
||||
const message = String(response?.payload?.message || response?.message || 'Не удалось получить блок.');
|
||||
const message = String(response?.payload?.message || response?.message || t('remaining.blockchain_snapshot.could_not_retrieve_block'));
|
||||
throw new Error(`Не удалось скачать блок ${blockNumber}: ${message}`);
|
||||
}
|
||||
const blockBytes = decodeBase64ToBytes(response?.payload?.blockBytesB64 || '');
|
||||
|
||||
Reference in New Issue
Block a user