-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* attempt number 2! * wow it finally works * should failed on no address * add more parse test * check constranints * (test) paginator attempt 3 * spandex * fix address test * return list * bring back paginator * get utxo * fix spec OMG.Crypto.address_t() * remove redundancy * add data paginator * wtf it works * all passed * fix eth_event_test * fix another eth event test failed * fix response schemas for account get utxo * fix request body yamal * improve description * add new line * add new line * mix format * format mix * fix test * fix test * fix naming * format mix * fix warning error * add paging test case * add pagination test * fix limit on swagger * format test * fix get_utxo spect * sort alias * add leser validate * remove empty lines * change name optional_lesser * add todo for watcher info api test cabbage for monday ! * new line * mix format * rename optional lesser * add limit for block and transaction count * if con test * add feature for alice call * alice_addr * take only single account * fix account array * add required * okay runnable test... gosh * add alias for apimoedl * fix fixture * test 2 utxo * format * fix patterm atching * yay working * update info api spec * change to pure call * _alice_priv fix warning * add payload * fix pattern matching * dynamic value * remove fixture * fix key as string for map * test single tx * format * more format * fix sometimes failed test * test pagination * format * fix expression * fix pattern match * remove warning * update make file * use ipoller * fix default limit * default paging * remove unused utxo * fix mix warn * Update priv/cabbage/apps/itest/test/features/watcher_info_api.feature Co-Authored-By: Ino Murko <[email protected]> * fix comments and eng * fix scenario * mix format * fix scnerio * format * fix comments * mix format * use to atom * mix format * mix format * add atom * wow it works * alias * mix format * add helper spec * fix lint * update doc * fix type spec for all existing paginator * fix paginator type * t(%__MODULE__{}) for own paginator * fix the last man standing paginator spec * okay i lied not last one * fix paginator * fix missing ) * change type Co-authored-by: Ino Murko <[email protected]> Co-authored-by: Unnawut Leepaisalsuwanna <[email protected]>
- Loading branch information
1 parent
b22ea96
commit 4389bce
Showing
29 changed files
with
438 additions
and
82 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
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
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
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
35 changes: 35 additions & 0 deletions
35
apps/omg_watcher_rpc/lib/web/validators/account_constraints.ex
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,35 @@ | ||
# Copyright 2019-2020 OmiseGO Pte Ltd | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
defmodule OMG.WatcherRPC.Web.Validator.AccountConstraints do | ||
@moduledoc """ | ||
Validates `/account.get_utxos` query parameters | ||
""" | ||
|
||
alias OMG.WatcherRPC.Web.Validator.Helpers | ||
|
||
@doc """ | ||
Validates possible query constraints, stops on first error. | ||
""" | ||
@spec parse(%{binary() => any()}) :: {:ok, Keyword.t()} | {:error, any()} | ||
def parse(params) do | ||
constraints = [ | ||
{"limit", [pos_integer: true, lesser: 1000, optional: true], :limit}, | ||
{"page", [:pos_integer, :optional], :page}, | ||
{"address", [:address], :address} | ||
] | ||
|
||
Helpers.validate_constraints(params, constraints) | ||
end | ||
end |
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.