Skip to content

Commit 5ea318a

Browse files
spivachukashcherbakov
authored andcommitted
INDY-895: Fixed issues with SCHEMA and CLAIM_DEF (#406)
- Fixed issues with processing SCHEMA and CLAIM_DEF transactions in the migration script removing null values from the domain ledger. - Corrected numbers of the versions in the name of the helper of 1_0_28_to_1_0_29 migration script. Signed-off-by: Nikita Spivachuk <[email protected]>
1 parent 32652f6 commit 5ea318a

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

Diff for: data/migrations/deb/1_0_28_to_1_0_29.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
os.path.normpath(
1414
os.path.join(
1515
os.path.dirname(os.path.abspath(__file__)),
16-
'helper_1_0_96_to_1_0_97.py'))
16+
'helper_1_0_28_to_1_0_29.py'))
1717

1818
logger.info('script path {}'.format(migration_script_path))
1919
ret = subprocess.run(

Diff for: data/migrations/deb/helper_1_1_37_to_1_1_38.py

-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
#!/usr/bin/python3.5
22
import fileinput
3-
import json
43
import os
54
import shutil
65
import sys
76

8-
from common.serializers.json_serializer import JsonSerializer
9-
from common.serializers.mapping_serializer import MappingSerializer
107
from ledger.compact_merkle_tree import CompactMerkleTree
118
from ledger.ledger import Ledger
12-
from plenum.common.constants import TXN_TYPE, DATA
139
from plenum.persistence.leveldb_hash_store import LevelDbHashStore
1410
from stp_core.common.log import getlogger
1511

1612
from sovrin_common.config_util import getConfig
17-
from sovrin_common.constants import SCHEMA, CLAIM_DEF
1813

1914
logger = getlogger()
2015

@@ -44,12 +39,6 @@ def __migrate_ledger(data_directory,
4439

4540
# add all txns into the new ledger
4641
for _, txn in old_ledger.getAllTxn():
47-
if txn[TXN_TYPE] == SCHEMA:
48-
if DATA in txn:
49-
txn[DATA] = json.loads(txn[DATA])
50-
if txn[TXN_TYPE] == CLAIM_DEF:
51-
if DATA in txn:
52-
txn[DATA] = json.loads(txn[DATA])
5342
# remove all NULL values from there!
5443
txn = __prepare_old_txn(txn)
5544
print(txn)

0 commit comments

Comments
 (0)