Skip to content

Commit

Permalink
Merge pull request #1566 from BalancerMaxis/style/end-json-dump-with-…
Browse files Browse the repository at this point in the history
…newline

style: end json dump files with newline
  • Loading branch information
gosuto-inzasheru authored Dec 11, 2024
2 parents c2247df + 3e39a10 commit 33b2dc4
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions action-scripts/gen_add_permissions_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def save_txbuilder_json(change_list, output_dir, filename_root=today):
# Save tx builder json
with open(f"{output_dir}/{filename_root}_{chain_name}.json", "w") as f:
json.dump(dict(data), f, indent=2)
f.write("\n")


def main(
Expand Down
1 change: 1 addition & 0 deletions action-scripts/merge_pr_jsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ def main():
file_path = os.path.join(dir_name_batched_full, file_name)
with open(file_path, "w") as new_file:
json.dump(result, new_file, indent=2)
new_file.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions action-scripts/multi_merge_pr_jsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def main():
file_path = os.path.join(dir_name_batched_full, file_name)
with open(file_path, "w") as new_file:
json.dump(result, new_file, indent=2)
new_file.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions tools/python/aura_snapshot_voting/vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def create_vote_payload(vote_choices, prop):

with open(f"{output_dir}/payload.json", "w") as f:
json.dump(data, f, indent=4)
f.write("\n")

response = requests.post(
"https://relayer.snapshot.org/",
Expand Down
1 change: 1 addition & 0 deletions tools/python/brownie/great_ape_safe/ape_api/badger.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def queue_timelock(self, target_addr, signature, data, dump_dir, delay_in_days=2
"eta": eta,
}
json.dump(tx_data, f, indent=4, sort_keys=True)
f.write("\n")

def execute_timelock(self, queueTx_dir):
"""
Expand Down
1 change: 1 addition & 0 deletions tools/python/brownie/great_ape_safe/ape_api/balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def get_pool_data(self, update_cache=False):
]
with open("great_ape_safe/ape_api/helpers/balancer/pools.json", "w") as f:
json.dump(pool_data_filtered, f)
f.write("\n")
return pool_data_filtered

with open("great_ape_safe/ape_api/helpers/balancer/pools.json") as f:
Expand Down
1 change: 1 addition & 0 deletions tools/python/brownie/great_ape_safe/ape_api/cow.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def _sell(
os.makedirs(path, exist_ok=True)
with open(f"{path}{order_uid}.json", "w+") as f:
f.write(json.dumps(order_payload))
f.write("\n")

if origin != self.safe.address:
# can only sign if origin is safe
Expand Down
1 change: 1 addition & 0 deletions tools/python/brownie/helpers/balancerGaugeInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def buildGaugesDictFromContract():
def write_gauge_outputs(gauges_dict):
with open("output/gauges.json", "w") as jsonfile:
json.dump(gauges_dict, jsonfile)
jsonfile.write("\n")
with open("output/gauges.csv", "w") as csvfile:
csvfile.write("name, address, isActive\n")
for key, value in gauges_dict["active_gauges"].items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def getEvents(contract):
def write_gauge_outputs(gauges_dict):
with open("output/gauges.json", "w") as jsonfile:
json.dump(gauges_dict, jsonfile)
jsonfile.write("\n")
with open("output/gauges.csv", "w") as csvfile:
csvfile.write("name, address, isActive\n")
for key, value in gauges_dict["active_gauges"].items():
Expand Down
1 change: 1 addition & 0 deletions tools/python/brownie/scripts/csv_airdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def main():
print(txlist)
with open(JSON, "w") as output:
json.dump(payload, output, indent=2)
output.write("\n")


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@

with open("eulerBreakoutOutput.json", "w") as f:
json.dump(endjson, f)
f.write("\n")
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,6 @@ def bribe_balancer(gauge, mantissa, amount, rounds):
payload["transactions"] = tx_list
with open(f"../../../BIPs/00rebateRecycling/{today}.json", "w") as f:
json.dump(payload, f)
f.write("\n")
print(f"USDC to Bribs: {total_mantissa}")
print(f"USDC payments: {payments}")
1 change: 1 addition & 0 deletions tools/python/generate_new_chain_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ def lookup_caller(caller):

with open("../../BIPs/00batched/authorizer/new-chain-template.json", "w") as f:
json.dump(template, f, indent=2)
f.write("\n")
1 change: 1 addition & 0 deletions tools/python/mimicTestSweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def generateSweepFile(sourcefile):
)
with open(f"{target_dir}/out/{today}-{chain}.json", "w") as f:
json.dump(dict(tx_out_map), f)
f.write("\n")
with open(f"{target_dir}/out/{today}-{chain}.report.txt", "w") as f:
f.write(report)

Expand Down
1 change: 1 addition & 0 deletions tools/python/standardize_poolRateCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def main(chain="mainnet"):

with open(f"./rateChangeTxList.json", "w") as f:
json.dump(tx_list, f)
f.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions tools/python/sweepFees.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def generateSweepFile(sourcefile):
tx_out_map.transactions[0].contractInputsValues.amounts = str(list(sweeps.values()))
with open(f"{target_dir}/out/{today}-{chain}.json", "w") as f:
json.dump(dict(tx_out_map), f)
f.write("\n")
with open(f"{target_dir}/out/{today}-{chain}.report.txt", "w") as f:
f.write(report)

Expand Down
1 change: 1 addition & 0 deletions tools/python/sweepFeesNoJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def generateSweepFile(tokenlist):
tx_out_map.transactions[0].contractInputsValues.amounts = str(list(sweeps.values()))
with open(f"{target_dir}/out/{today}-{chain}.json", "w") as f:
json.dump(dict(tx_out_map), f)
f.write("\n")
with open(f"{target_dir}/out/{today}-{chain}.report.txt", "w") as f:
f.write(report)

Expand Down

0 comments on commit 33b2dc4

Please sign in to comment.