Skip to content

Commit 7eba476

Browse files
committed
gen addresses script: fix output ordering
1 parent 3ec8749 commit 7eba476

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

script/genAddressesJson.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ const main = async () => {
2929
[chain: string]: { [label: string]: string };
3030
} = {};
3131

32+
// as we are using Promise all here, so the order of the chains might not be maintained
3233
await Promise.all(
3334
chains.map(async (chain) => {
3435
output[chain] = await addressesForChain(chain);
3536
})
3637
);
3738

38-
const formattedJson = prettier.format(JSON.stringify(output), {
39+
let orderedOutput: { [chain: string]: { [label: string]: string } } = {};
40+
chains.forEach((chain) => {
41+
orderedOutput[chain] = output[chain];
42+
});
43+
44+
const formattedJson = prettier.format(JSON.stringify(orderedOutput), {
3945
parser: "json",
4046
});
4147

0 commit comments

Comments
 (0)