Commit Graph

112 Commits

Author SHA1 Message Date
Arnau B
86029ca7de Improve swagger doc 2020-11-24 11:39:29 +01:00
Arnau B
ce1218e28a Integrate til into api 2020-11-17 17:50:07 +01:00
laisolizq
b3b23473b6 Add til api test first commit 2020-11-17 11:24:19 +01:00
Eduard S
e731b79e96 Fix exit table, set delayed_withdrawn in exits
- In exit table, `instant_withdrawn`, `delayed_withdraw_request`, and
  `delayed_withdrawn` were referencing batch_num.  But these actions happen
  outside a batch, so they should reference a block_num.
- Process delayed withdrawns:
    - In Synchronizer, first match a Rollup delayed withdrawn request, with the
      WDelayer deposit (via TxHash), and store the owner and token associated
      with the delayed withdrawn.
    - In HistoryDB: store the owner and token of a delayed withdrawal request
      in the exit_tree, and set delayed_withdrawn when the withdraw is done in
      the WDelayer.
- Update dependency of sqlx to master
    - Last release of sqlx is from 2018 October, and it doesn't support
      `NamedQuery` with a slice of structs, which is used in this commit.
2020-11-13 16:53:16 +01:00
arnau
8cc165f562 Merge pull request #275 from hermeznetwork/feature/api-db-tests-til
Feature/api db tests til
2020-11-11 15:54:41 +01:00
Arnau B
bed25d424a Use til for batches and blocks at historydb 2020-11-11 14:00:19 +01:00
ToniRamirezM
6919b561a5 Swagger Review
Swagger Review
2020-11-11 09:33:31 +01:00
laisolizq
43e9bee9db API state endpoint test 2020-11-10 13:47:18 +01:00
laisolizq
9edf9d2168 API State RecommendedFee 2020-11-09 17:57:23 +01:00
a_bennassar
a1b9720e77 Merge pull request #270 from hermeznetwork/feature/api-state-metrics
API State Metrics
2020-11-09 16:54:25 +01:00
ToniRamirezM
55a78fbd72 API State Metrics 2020-11-09 16:50:15 +01:00
Eduard S
8190755d49 Merge pull request #268 from hermeznetwork/feature/wrapped-in-struct
Refactor api pagination
2020-11-09 15:32:28 +01:00
laisolizq
cc6446e019 API add get state 2020-11-09 13:01:28 +01:00
Arnau B
d2e9196fba Refactor api pagination 2020-11-09 12:58:09 +01:00
Eduard S
220fd992c5 Merge pull request #263 from hermeznetwork/feature/wrapped-in-struct
Put api DBs into struct
2020-11-06 15:05:53 +01:00
Arnau B
1112ded933 Put api DBs into struct 2020-11-06 12:00:56 +01:00
laisolizq
22f0a45118 ItemID to uint64 & check timestamp 2020-11-06 10:40:57 +01:00
ToniRamirezM
b840ceb57a Account API 2020-11-06 09:30:32 +01:00
a_bennassar
1a9c96a720 Merge pull request #251 from hermeznetwork/feature/api-slots
API add slots endpoints
2020-11-05 16:04:43 +01:00
laisolizq
5012b82914 API add slots endpoints 2020-11-05 15:59:27 +01:00
ToniRamirezM
f90f14d0c1 Check feeAmount overflow in API 2020-11-05 12:15:47 +01:00
laisolizq
2cf41d3707 API config refactor 2020-11-04 14:45:18 +01:00
arnau
11dbf67377 Merge pull request #250 from hermeznetwork/feature/integration9
Reorganize smart contract types, udate eth tests, etc.
2020-11-04 12:36:42 +01:00
Eduard S
e6fb0a03de Reorganize smart contract types, udate eth tests, etc.
- Move smart contract constants and structs for variables to
  common/{ethrollup.go, ethauction.go, ethwdelayer.go}:
    - This removes repeated code of the structs for variables
    - Allows reusing the constants and variables from all modules without
      import cycles
- Remove unused common/scvars.go
- In common.BlockData, split data from each smart contract into a sepparate
  field (Rollup, Auction, WDelayer).  This affects the structures that til uses
  as output, and HistoryDB in the AddBlockSCData.
- In Synchronizer:
    - Pass starting block of each smart contract as config, instead of
      incorrectly using the genesis block found in the acution constant (which
      has a very different meaning)
    - Use variable structs from common instead of an internal copy
    - Synchronize more stuff (resolve some TODOs)
    - Fix some issues found after initial testing with ganache
- In eth:
    - In auction.go: Add method to get constants
    - Update README to use ganache instead of buidlerevm as local blockchain
      for testing
    - Update env variables and test vectors to pass the tests with the
      deployment in the ganache testnet.
    - Use ethereum keys derived from paths (hdwallet) in testing to avoid
      hardcoding private keys and generate the same keys from a mnemonic used
      in the ganache tesnet.
2020-11-04 12:06:28 +01:00
laisolizq
04d969c274 API add pending withdraws filter on GET /exits 2020-11-03 16:12:58 +01:00
Arnau B
233ecc4704 Refactor api exits 2020-11-02 14:00:42 +01:00
Arnau B
8c9d13ffa5 Refactor account creation auth endpoints 2020-11-02 13:58:42 +01:00
Arnau B
cbeca0f76e Insert ETH as HistoryDB token 2020-11-02 12:09:09 +01:00
Arnau B
e0e3299d9f Imp api get full-batches 2020-10-30 16:26:33 +01:00
laisolizq
aa6cb6f818 API add bids endpoint 2020-10-28 18:11:52 +01:00
Arnau B
a329d894d2 Refactor api txs 2020-10-28 12:16:35 +01:00
ToniRamirezM
b521a77fc5 API Coordinator Refactor 2020-10-27 17:44:22 +01:00
laisolizq
bc34f3456b API Update tokens endpoint 2020-10-27 13:23:01 +01:00
laisolizq
82ee7c6aa7 Add struct get state endpoint 2020-10-27 12:27:04 +01:00
Arnau B
28c0164525 Impl api get batch(es) 2020-10-26 12:42:05 +01:00
Arnau B
7c8f380637 Add apitypes to avoid parsing from/to DB 2020-10-26 12:41:55 +01:00
Arnau B
ede6c33a18 Impl account creation auth endpoints 2020-10-23 13:05:20 +02:00
Arnau B
9971f13646 Add the ability to run the API forever when testing 2020-10-23 11:51:53 +02:00
Eduard S
24bca9e3b0 Merge pull request #216 from hermeznetwork/feature/batch-total-fee
Calulate total collected batch fee and fix merkleproof api format
2020-10-22 14:28:49 +02:00
ToniRamirezM
f314498a26 Coordinators methods for API 2020-10-22 13:29:38 +02:00
Arnau B
f77ea04c2e Calulate total collected batch fee and fix merkleproof api format 2020-10-22 12:59:15 +02:00
Arnau B
006bbf3321 Implement tx pool endpoints 2020-10-21 16:34:54 +02:00
Eduard S
4ca2124cf9 Merge pull request #210 from hermeznetwork/feature/api-config-const
Add config endpoint
2020-10-21 13:30:00 +02:00
arnau
6a8b454368 Merge pull request #211 from hermeznetwork/feature/update-general
Feature/update general
2020-10-21 13:06:09 +02:00
laisolizq
f90de219ac Add config endpoint 2020-10-20 19:12:02 +02:00
Eduard S
88ddbbcddc Delete tmp folders from tests, Resolve #105 2020-10-20 13:13:10 +02:00
a_bennassar
eb54162fb8 Merge pull request #204 from hermeznetwork/feature/api-gettokens
Add get tokens endpoint
2020-10-19 11:20:41 +02:00
laisolizq
043710112d Add get tokens endpoint 2020-10-19 10:14:18 +02:00
Alberto Elias
b2f0b2e314 Updates request and load amounts 2020-10-16 10:50:15 +02:00
Alberto Elias
ce283d4419 More realistic example amounts 2020-10-15 17:39:56 +02:00