From 344820b6aa7c9b8868b93ad0d3d74f9f7355aa7c Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 10 Jun 2020 17:41:40 +0300 Subject: [PATCH] protocol version update --- core/primitives/src/version.rs | 2 +- neard/res/genesis_config.json | 2 +- scripts/migrations/23-delete_action_last.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 scripts/migrations/23-delete_action_last.py diff --git a/core/primitives/src/version.rs b/core/primitives/src/version.rs index 255cd739b80..a16cc80d9ae 100644 --- a/core/primitives/src/version.rs +++ b/core/primitives/src/version.rs @@ -17,6 +17,6 @@ pub const DB_VERSION: DbVersion = 1; pub type ProtocolVersion = u32; /// Current latest version of the protocol. -pub const PROTOCOL_VERSION: ProtocolVersion = 22; +pub const PROTOCOL_VERSION: ProtocolVersion = 23; pub const FIRST_BACKWARD_COMPATIBLE_PROTOCOL_VERSION: ProtocolVersion = PROTOCOL_VERSION; diff --git a/neard/res/genesis_config.json b/neard/res/genesis_config.json index b98ae21372b..5fc572b9ea9 100644 --- a/neard/res/genesis_config.json +++ b/neard/res/genesis_config.json @@ -1,5 +1,5 @@ { - "protocol_version": 22, + "protocol_version": 23, "genesis_time": "1970-01-01T00:00:00.000000000Z", "chain_id": "sample", "genesis_height": 0, diff --git a/scripts/migrations/23-delete_action_last.py b/scripts/migrations/23-delete_action_last.py new file mode 100644 index 00000000000..e358a1f7577 --- /dev/null +++ b/scripts/migrations/23-delete_action_last.py @@ -0,0 +1,19 @@ +""" +Refund allowance in the access key for unused gas fees. +""" + +import sys +import os +import json +from collections import OrderedDict + +home = sys.argv[1] +output_home = sys.argv[2] + +config = json.load(open(os.path.join(home, 'output.json')), object_pairs_hook=OrderedDict) + +assert config['protocol_version'] == 22 + +config['protocol_version'] = 23 + +json.dump(config, open(os.path.join(output_home, 'output.json'), 'w'), indent=2)