-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
5 changed files
with
60 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#! /bin/sh | ||
set -e | ||
|
||
BLOCKCHAIN=icrc NODE_URL=https://icrc-rosetta-ckbtc.santiment.net CKBTC_NODE_URL=https://icrc-rosetta-ckbtc.santiment.net CKETH_NODE_URL=https://icrc-rosetta-cketh.santiment.net CKUSDC_NODE_URL=https://icrc-rosetta-ckusdc.santiment.net CKUSDT_NODE_URL=https://icrc-rosetta-ckusdt.santiment.net docker compose -f docker/docker-compose.yaml up --build | ||
docker compose -f docker/docker-compose.yaml rm -f |
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,26 @@ | ||
function transactionOrder(a, b) { | ||
return a.blockNumber - b.blockNumber || a.transactionPosition - b.transactionPosition; | ||
} | ||
|
||
function stableSort(array, sortFunc) { | ||
array.forEach((x, i) => x._position = i); | ||
|
||
array.sort(function (a, b) { | ||
let sortResult = sortFunc(a, b); | ||
if (sortResult !== 0) { | ||
return sortResult; | ||
} | ||
else { | ||
return a._position - b._position; | ||
} | ||
}); | ||
|
||
array.forEach(x => delete x._position); | ||
} | ||
|
||
|
||
module.exports = { | ||
transactionOrder, | ||
stableSort | ||
}; | ||
|
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
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,26 @@ | ||
function transactionOrder(a, b) { | ||
return a.blockNumber - b.blockNumber || a.transactionPosition - b.transactionPosition; | ||
} | ||
|
||
function stableSort(array, sortFunc) { | ||
array.forEach((x, i) => x._position = i); | ||
|
||
array.sort(function (a, b) { | ||
let sortResult = sortFunc(a, b); | ||
if (sortResult !== 0) { | ||
return sortResult; | ||
} | ||
else { | ||
return a._position - b._position; | ||
} | ||
}); | ||
|
||
array.forEach(x => delete x._position); | ||
} | ||
|
||
|
||
module.exports = { | ||
transactionOrder, | ||
stableSort | ||
}; | ||
|