mirror of https://github.com/nucypher/nucypher.git
Bump character configuration to v8 and add migration script.
parent
33068070fc
commit
94dc933c73
|
@ -303,7 +303,7 @@ class CharacterConfiguration(BaseConfiguration):
|
||||||
'Sideways Engagement' of Character classes; a reflection of input parameters.
|
'Sideways Engagement' of Character classes; a reflection of input parameters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
VERSION = 7 # bump when static payload scheme changes
|
VERSION = 8 # bump when static payload scheme changes
|
||||||
|
|
||||||
CHARACTER_CLASS = NotImplemented
|
CHARACTER_CLASS = NotImplemented
|
||||||
MNEMONIC_KEYSTORE = False
|
MNEMONIC_KEYSTORE = False
|
||||||
|
|
|
@ -5,6 +5,7 @@ from .configuration_v3_to_v4 import configuration_v3_to_v4
|
||||||
from .configuration_v4_to_v5 import configuration_v4_to_v5
|
from .configuration_v4_to_v5 import configuration_v4_to_v5
|
||||||
from .configuration_v5_to_v6 import configuration_v5_to_v6
|
from .configuration_v5_to_v6 import configuration_v5_to_v6
|
||||||
from .configuration_v6_to_v7 import configuration_v6_to_v7
|
from .configuration_v6_to_v7 import configuration_v6_to_v7
|
||||||
|
from .configuration_v7_to_v8 import configuration_v7_to_v8
|
||||||
|
|
||||||
MIGRATIONS = OrderedDict(
|
MIGRATIONS = OrderedDict(
|
||||||
{
|
{
|
||||||
|
@ -14,5 +15,6 @@ MIGRATIONS = OrderedDict(
|
||||||
(4, 5): configuration_v4_to_v5,
|
(4, 5): configuration_v4_to_v5,
|
||||||
(5, 6): configuration_v5_to_v6,
|
(5, 6): configuration_v5_to_v6,
|
||||||
(6, 7): configuration_v6_to_v7,
|
(6, 7): configuration_v6_to_v7,
|
||||||
|
(7, 8): configuration_v7_to_v8,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
from nucypher.config.migrations.common import perform_migration
|
||||||
|
|
||||||
|
|
||||||
|
def __migration(config: Dict) -> Dict:
|
||||||
|
# deprecations
|
||||||
|
del config["pre_payment_network"]
|
||||||
|
|
||||||
|
# eth_provider_uri -> eth_endpoint
|
||||||
|
config["eth_endpoint"] = config["eth_provider_uri"]
|
||||||
|
del config["eth_provider_uri"]
|
||||||
|
|
||||||
|
# pre_payment_provider -> polygon_endpoint
|
||||||
|
config["polygon_endpoint"] = config["pre_payment_provider"]
|
||||||
|
del config["pre_payment_provider"]
|
||||||
|
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
def configuration_v7_to_v8(filepath) -> None:
|
||||||
|
perform_migration(
|
||||||
|
old_version=7, new_version=8, migration=__migration, filepath=filepath
|
||||||
|
)
|
Loading…
Reference in New Issue