Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add myth delivery fee #3090

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions scripts/print_xcm_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,42 @@ def compare_files(actual_json, new_json, chains_json):
compare_destinations(changed_values, prod_chain_dict,
new_chain_dict, chains_json_dict)

compare_network_delivery_fee(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, script for show delivery fee changes was added

changed_values,
actual_json.get('networkDeliveryFee', {}),
new_json.get('networkDeliveryFee', {}),
chains_json_dict
)

return changed_values


def compare_network_delivery_fee(object_accumulator, actual_network_delivery_fee, new_network_delivery_fee, chains_json_dict):
"""Compare network delivery fee between production and changed json

Args:
object_accumulator (dict): This object accumulate all changes
actual_network_delivery_fee (dict): Dictionary with actual network delivery fee
new_network_delivery_fee (dict): Dictionary with changed network delivery fee
chains_json_dict (dict): Dictionary with chains.json
"""
for chain_id, fee_data in new_network_delivery_fee.items():
chain_name = chains_json_dict[chain_id].get('name', chain_id)
if chain_id not in actual_network_delivery_fee:
object_accumulator['networkDeliveryFee'][chain_name] = 'Added'
else:
if fee_data != actual_network_delivery_fee[chain_id]:
object_accumulator['networkDeliveryFee'][chain_name] = {
'old_value': actual_network_delivery_fee[chain_id],
'new_value': fee_data
}

for chain_id in actual_network_delivery_fee:
chain_name = chains_json_dict[chain_id].get('name', chain_id)
if chain_id not in new_network_delivery_fee:
object_accumulator['networkDeliveryFee'][chain_name] = 'Removed'


def main(argv):
"""It will compare transfers.json from endpoint and local file, then print changes. Depends on parametrs it will print changes for dev or prod environment. Also it prepared as to run locally with default parameters, as to run in CI/CD pipeline with parameters from environment variables.

Expand Down
16 changes: 16 additions & 0 deletions xcm/v6/transfers_dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,22 @@
"sizeFactor": "100000",
"alwaysHoldingPays": false
}
},
"f6ee56e9c5277df5b4ce6ae9983ee88f3cbed27d31beeb98f9f84f997a1ab0b9": {
"toParent": {
"type": "exponential",
"factorPallet": "ParachainSystem",
"sizeBase": "300000000",
"sizeFactor": "100000",
"alwaysHoldingPays": false
},
"toParachain": {
"type": "exponential",
"factorPallet": "XcmpQueue",
"sizeBase": "300000000",
"sizeFactor": "100000",
"alwaysHoldingPays": false
}
}
},
"networkBaseWeight": {
Expand Down
Loading