-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dynamic cal * dynamic call script edit * readd spl token * mobile dyn cal * remove spl tokens * cal importer with s3 staging * move to ubuntu latest for aws * cal importer in folder * staging dyn cal * fix caching on staging env dyn cal * dyncal erc20-signatures * Feedback from github * fix lint * staging change role * try-selfhosted * selfrunner for aws * change yalm runner * change yalm runner * reomve runner * update doc * Test + bugfix on integration Co-authored-by: Kévin Lambert <[email protected]> * update lock + add schedule to importer * cal importer with prod env * change find to getCryptoCurrencyById * prod cal importer * prd cal importer * redoing cache * fix: different ref * typing * lint fix * add tojson method * feedback fix * add cache for findERC20Signature * better with save file * cache fix lint * remove cache from dyn cal et add it to static * add return * revert pnpm-lock Co-authored-by: Kévin Lambert <[email protected]>
- Loading branch information
1 parent
ffc377d
commit f5f4db4
Showing
31 changed files
with
545 additions
and
100 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 @@ | ||
--- | ||
"@ledgerhq/hw-app-eth": minor | ||
--- | ||
|
||
Dynamic cal for erc20 |
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 @@ | ||
--- | ||
"live-mobile": minor | ||
--- | ||
|
||
Dynamic cal for erc20 |
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 @@ | ||
--- | ||
"ledger-live-desktop": minor | ||
--- | ||
|
||
Dynamic cal for erc20 |
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,58 @@ | ||
name: "Dynamic cal importer ERC20" | ||
on: | ||
schedule: | ||
- cron: 0 7 * * * | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- feat/LIVE-2174-dynamic-cal | ||
|
||
concurrency: | ||
group: bot-dyn-cal | ||
|
||
jobs: | ||
run-bot: | ||
runs-on: [self-hosted, ledger-live-assets] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Retrieving crypto-assets | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
repository: LedgerHQ/crypto-assets | ||
token: ${{ secrets.CI_BOT_TOKEN }} | ||
path: crypto-assets | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: latest | ||
run_install: false | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: install and build | ||
continue-on-error: true | ||
run: | | ||
pnpm i --filter="live-cli..." --filter="ledger-live" --filter="ledger-libs" --frozen-lockfile | ||
pnpm build:ljs | ||
shell: bash | ||
- name: run script | ||
run: | | ||
mkdir cal | ||
node libs/ledgerjs/script/crypto-assets-importer/index.js $PWD/crypto-assets true | ||
mv libs/ledgerjs/packages/cryptoassets/data/**.json cal | ||
- name: Deploy json to s3 | ||
run: aws s3 sync ./cal/ s3://ledger-live-cryptoassets-prd/cryptoassets --delete | ||
- name: Cache invalidate | ||
run: aws cloudfront create-invalidation --distribution-id E53IORS7MW883 --paths "/cryptoassets/*" --debug |
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
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
44 changes: 44 additions & 0 deletions
44
libs/ledger-live-common/src/families/ethereum/modules/erc20.unit.test.ts
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,44 @@ | ||
import { fetchERC20Tokens } from "./erc20"; | ||
|
||
beforeEach(() => { | ||
jest.resetModules(); | ||
}); | ||
|
||
jest.mock("../../../network", () => { | ||
return jest.fn().mockImplementationOnce(() => ({ | ||
data: [ | ||
[ | ||
"ethereum", | ||
"$aapl", | ||
"$AAPL", | ||
18, | ||
"$AAPL", | ||
"3045022100a1e0859e2ad886121b0c5bb374622dcee83b6b0b26a5552559b56a328e4d50ad02202efc09d46a0770a40c6a650a9eec00ba9d8a6727a369398a5f8e3f1d698ccc71", | ||
"0x41eFc0253ee7Ea44400abB5F907FDbfdEbc82bec", | ||
true, | ||
false, | ||
], | ||
[ | ||
"ethereum", | ||
"$based", | ||
"$BASED", | ||
18, | ||
"$BASED", | ||
"304402207e5be628591465b9ee45b62d5d067beb99ead27485874371b213037137b60a9702205339b3d713d990b5c614a98c20b113978ae36ff72324183d35673a40b71493fc", | ||
"0x68A118Ef45063051Eac49c7e647CE5Ace48a68a5", | ||
false, | ||
false, | ||
], | ||
], | ||
})); | ||
}); | ||
|
||
describe("fetch ERC20 Tokens", () => { | ||
it("normal behaviour", async () => { | ||
expect((await fetchERC20Tokens()).length).toBe(2); | ||
}); | ||
|
||
it("not able to fetch", async () => { | ||
expect((await fetchERC20Tokens()).length).toBe(0); | ||
}); | ||
}); |
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
Oops, something went wrong.
f5f4db4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏲ 28min 27s ✅ 108 txs ❌ 5 txs ($984.29) for [Bot] non-reg on develop with 'Phosphore'
❌ 5 mutation errors
Portfolio ($984.29) – Details of the 42 currencies
32PI2C5HLHMVUF5KMNURLGCTYVIOVJJ2NLHLZ2PIMK567MKMS4RXBSVWQI
bc1qtmdltwjkf4s0tn45hnwe5astlha6ptrrhp2dsv
tb1q59czulq2wz9zzyr3vpw2ktrfxmasakjpf4ujfr
qqwjf2d38ferjd7lzj79zgmlanphs9jw2cxvh506fs
ANiiAvYnASpWJtqfvxfpmd5CLik6vWQcZo
XjP72JzGgxRbSZDEnCcYWvzZ1Ygj3aCQSJ
dgb1qsag60dehx4jcmfw2mzv5pfhuy22hcn0870x4m4
DSEoSvPRB5rLoFsJ55wW1w3N5JASZ2xq3c
RCBN7ns2cT3ETWkeoVmZUesU65yNfurFVs
ltc1q52uqfgd57gz2r3cv23zpg838a2lptmfaln9enn
PM2GaaxfdjHgD4QEbTuJxTnFXbxsdCYEGA
DAUb1pWH4BJCQePkZ95KyVbTohd7J6cXfx
MRc2HFA5vpVXCpPmQ2dhHiPvZQkAUgACHr
3NZqTzmAsRZdHfin23oYZTRaBSWNgRtPek
EW5k38DggpGhoK7tmGFaj92scNSf4oFqNF
t1R21LG7afusXCdqzW4v6bEVnreM3iGQC35
znS2FFcZc9QZCsLBhZLvqcGnkBfCY9fMV9X
DsenkdkC2omHXpAxnD4St4JWHZDAcncrmnR
addr1qx8pdm5l84hdq7695n79ea84eu4w7qqvt3jeeqjs2fx9swrrkxr0sr9fx363v03pw5cx4qumlnjrtquc0d09ny85e2ysed068z
0xCc7187772b999d669845d0D72660F388781575DB
cosmos1ga5n0llpm9dqmvmac92tqffrwwlhexppmts4s7
cro1hh3ygrlneu3whlsjcsa2akrwm00ujy2ggxk7v9
erd10f45c5x4997ctt5ye45vfzkvzsutwyd5rgw0zxsmneay90kyc0tq809pjy
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0x556ad802f06ae3BE9fC48D4bEcDE703a9B9F7b29
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
0xa22CA840265d3C5CB1846e419B14c6a6CdD06FAB
f176iafb4evnhhfzd5bhdzsjbbfs5st6eb4neplki
0.0.942690
osmo1ga5n0llpm9dqmvmac92tqffrwwlhexppnsr9xv
15jLBbe9LD6VSUYFkV5Fmo5LhZU5cns9E6g8qcDv5KrKM1eP
rP8phQ7XgRozw8Wg8cTgkWPT9ZL4VDydfQ
5XD9JtUQMBrYBkqSUD9rnJcSSrADMkUuotZSwZPWM8nZ
GCXE56DP3YWR34L5OTEV6UJKXFEAGYIK7X6SAXF4ZB4VQAOH5I4ERYOP
tz1feA619tG2iPwCCUFCL72yC6bgwjDTD8FF
TRbtdwHowocq8ThZbRnTHgK4JG5sx3fFCK
Performance ⏲ 28min 27s
Time spent for each spec: (total across mutations)