Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 29ac4ed

Browse files
committed
include main
1 parent 01aa0a5 commit 29ac4ed

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

js/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ async function sync(url, get_api_from_url, parseNeuronData, blockHash=undefined)
8989
}
9090
api = await api.at(blockHash);
9191

92-
const neurons = await refreshMeta(api, parseNeuronData);
92+
const neurons_unordered = await refreshMeta(api, parseNeuronData);
93+
const neurons = neurons_unordered.sort((a, b) => a.uid - b.uid);
9394
return neurons;
9495
}
9596

@@ -133,8 +134,8 @@ function parseNeuronData( neuron_data ) {
133134

134135
async function refreshMeta(api, parseNeuronData) {
135136
const neuron_entries = await api.query.subtensorModule.neurons.entries();
136-
const neurons = parseNeuronData(neuron_entries.map(entry => entry[1].value));
137-
return neurons
137+
const neurons_unordered = parseNeuronData(neuron_entries.map(entry => entry[1].value));
138+
return neurons_unordered;
138139
}
139140

140141
async function sync_and_save(url, filename, blockHash=undefined, fd=undefined) {

0 commit comments

Comments
 (0)