Skip to content

Conversation

@matteenm
Copy link
Collaborator

@matteenm matteenm commented Jun 7, 2022

This PR adds a call to the token-list-bridge-utils chainify function as part of the buildList.js script. This takes the generated L1 list and appends an extensions.bridgeInfo field to the token entries in the list which contains cross-chain address mapping information. The mappings will not be fully inclusive/complete, as we are limited to what the sources that token-list-bridge-utils uses provide.

generated cross-chain token list file:
uniswap-default.tokenlist.txt

@matteenm matteenm force-pushed the matteen-tokenlist-crosschain branch from 2d7e6d2 to c3f389d Compare June 9, 2022 22:24
src/write.js Outdated
Comment on lines 1 to 5
console.log(JSON.stringify(buildList(), null, 2));

(async () => {
console.log(JSON.stringify(await buildList(), null, 2));
})();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can skip the async iife like this:

buildList().then(data => console.log(JSON.stringify(data, null, 2)))

module.exports = async function buildList() {
const parsed = version.split(".");
return {
const l1List = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this needs to be an async function. Returning the chainify result (I'm assuming it's a promise?) will give you the same behavior.

package.json Outdated
Comment on lines 37 to 39
},
"dependencies": {
"@uniswap/token-list-bridge-utils": "^1.0.7"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in devDependencies

package.json Outdated
"main": "build/uniswap-default.tokenlist.json",
"scripts": {
"test": "mocha",
"test": "mocha --timeout 10000",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to manually provide the timeout where it's necessary (using this.timeout(n)) instead of setting it globally and potentially slowing down the whole suite.

@matteenm matteenm force-pushed the matteen-tokenlist-crosschain branch from 0f17fb6 to 0579450 Compare June 10, 2022 16:18
@matteenm matteenm merged commit e4812e7 into main Jun 23, 2022
@matteenm matteenm deleted the matteen-tokenlist-crosschain branch June 23, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants