-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
435cf96
commit afb31a6
Showing
7 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"code_bytes": "lmao", | ||
"code_id": "3", | ||
"code_info": { | ||
"code_hash": "+bSrIgKlEQtlPn3+PkE7M20UI07UR9iC4dm9VRK0SJE=", | ||
"creator": "terra15kc4dkquya20yx09avpdw8796unj709xuyxjyc", | ||
"instantiate_config": { | ||
"address": "", | ||
"addresses": [], | ||
"permission": "Everybody" | ||
} | ||
}, | ||
"pinned": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"title": "Proposal to decrease MaxBlockSize", | ||
"description": "Proposal to decrease MaxBlockSize from 5mb to 2mb to avoid peer-to-peer spams", | ||
|
||
"changes": [ | ||
{ | ||
"subspace": "baseapp", | ||
"key": "BlockParams", | ||
"value": { | ||
"max_bytes": "2000000", | ||
"max_gas": "100000000" | ||
} | ||
} | ||
], | ||
"metadata": "AQ==", | ||
"deposit": "1000000000000uluna" | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import json | ||
|
||
# Load the JSON file | ||
with open('mytestnet/config/genesis.json', 'r') as f: | ||
data = json.load(f) | ||
|
||
# Define the expected structure | ||
expected_structure = { | ||
"code_bytes": str, | ||
"code_id": str, | ||
"code_info": { | ||
"code_hash": str, | ||
"creator": str, | ||
"instantiate_config": { | ||
"address": str, | ||
"addresses": list, | ||
"permission": str | ||
} | ||
}, | ||
"pinned": bool | ||
} | ||
|
||
# Function to check if a dictionary matches the expected structure | ||
# def check_structure(obj, expected): | ||
# if isinstance(obj, dict): | ||
# for key, value in expected.items(): | ||
# if key not in obj or not isinstance(obj[key], value): | ||
# return False | ||
# if isinstance(value, dict) and not check_structure(obj[key], value): | ||
# return False | ||
# return True | ||
# return False | ||
|
||
def check_structure(obj, expected): | ||
if isinstance(obj, dict): | ||
for key, value in expected.items(): | ||
if key not in obj: | ||
return False | ||
if isinstance(value, dict): | ||
if not isinstance(obj[key], dict): | ||
return False | ||
if not check_structure(obj[key], value): | ||
return False | ||
elif not isinstance(obj[key], value): | ||
return False | ||
return True | ||
return False | ||
|
||
# Check each element in the codes array | ||
for code in data['app_state']['wasm']['codes']: | ||
if not check_structure(code, expected_structure): | ||
print("Code structure is not as expected:", code) |
Binary file not shown.