Skip to content

Commit

Permalink
Merge pull request #3511 from TrueBlocks/fix/final-before-merge
Browse files Browse the repository at this point in the history
Fix/final before merge
  • Loading branch information
tjayrush committed Feb 15, 2024
2 parents 6a004ac + 999b520 commit d1a3947
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 88 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: [pull_request, workflow_dispatch]

env:
CHIFRA_PATH: src/apps/chifra
# Go Version
GO_VERSION: ^1.22

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
# Go Version
go-version: 1.22
- uses: actions/checkout@v3
- name: golangci-lint
Expand Down
18 changes: 0 additions & 18 deletions docs/content/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,24 +2364,6 @@ paths:
explode: true
schema:
type: boolean
- name: page
description: the page to retrieve
required: false
style: form
in: query
explode: true
schema:
type: number
format: uint64
- name: perPage
description: the number of records to request on each page
required: false
style: form
in: query
explode: true
schema:
type: number
format: uint64
- name: sleep
description: seconds to sleep between requests
required: false
Expand Down
7 changes: 5 additions & 2 deletions docs/content/chifra/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ This feature comes in handy when build shell scripts to automate various tasks w

## Where are configs stored?

Please see [TODO: PLACE_HODLER](#) for more information.
The configuration files for `chifra` are stored in the operating system specific locations in the
`TrueBlocks` folder.

## Separate files

A single global configuration, called `trueBlocks.toml`, is stored at the root of the configuration
folder.

In addition, each individual tool has its own configuration file with items peculuar to that tool.
In addition, each individual tool may have its own configuration file with items peculuar to that tool.
If a configuration item is found in a particular file, it applies only to that tool.

If, however, one of the items documented below under `trueBlocks.toml` is found in a tool's
Expand All @@ -71,6 +72,8 @@ chain's configuration folder, and the values found there will replace any values
top level. In this way, you may configure all chains for certain values, but customize your
configuration per chain.

Note: As of version 2.5.2, this is no longer true.

## Configuration files

<div style="padding:2px;padding-left:10px;background-color:green;color:white">trueBlocks.toml (all tools)</div>
Expand Down
3 changes: 0 additions & 3 deletions docs/content/chifra/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -104,7 +102,6 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
```

Data models produced by this tool:
Expand Down
3 changes: 0 additions & 3 deletions docs/readmes/other-slurp.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -46,7 +44,6 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
```

Data models produced by this tool:
Expand Down
2 changes: 0 additions & 2 deletions sdk/python/src/_slurp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"articulate": {"hotkey": "-a", "type": "switch"},
"source": {"hotkey": "-S", "type": "flag"},
"count": {"hotkey": "-U", "type": "switch"},
"page": {"hotkey": "-g", "type": "flag"},
"perPage": {"hotkey": "-P", "type": "flag"},
"sleep": {"hotkey": "-s", "type": "flag"},
"raw": {"hotkey": "-w", "type": "switch"},
"cache": {"hotkey": "-o", "type": "switch"},
Expand Down
4 changes: 1 addition & 3 deletions sdk/typescript/src/paths/slurp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file was generated with makeClass --sdk. Do not edit it.
*/
import * as ApiCallers from '../lib/api_callers';
import { address, blknum, double, Slurp, uint64 } from '../types';
import { address, blknum, double, Slurp } from '../types';

export function getSlurp(
parameters?: {
Expand All @@ -15,8 +15,6 @@ export function getSlurp(
articulate?: boolean,
source?: 'etherscan*' | 'key',
count?: boolean,
page?: uint64,
perPage?: uint64,
sleep?: double,
chain: string,
noHeader?: boolean,
Expand Down
11 changes: 7 additions & 4 deletions src/apps/chifra/cmd/slurp.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ Notes:
- An address must be either an ENS name or start with '0x' and be forty-two characters long.
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.`
- If the value of --source is key, --types is ignored and only appearances or counts are returned.`

func init() {
var capabilities = caps.Default // Additional global caps for chifra slurp
Expand All @@ -72,9 +71,13 @@ One or more of [ ext | int | token | nfts | 1155 | miner | uncles | withdrawals
slurpCmd.Flags().StringVarP(&slurpPkg.GetOptions().Source, "source", "S", "etherscan", `the source of the slurped data
One of [ etherscan | key ]`)
slurpCmd.Flags().BoolVarP(&slurpPkg.GetOptions().Count, "count", "U", false, "for --appearances mode only, display only the count of records")
slurpCmd.Flags().Uint64VarP(&slurpPkg.GetOptions().Page, "page", "g", 0, "the page to retrieve")
slurpCmd.Flags().Uint64VarP(&slurpPkg.GetOptions().PerPage, "per_page", "P", 3000, "the number of records to request on each page")
slurpCmd.Flags().Uint64VarP(&slurpPkg.GetOptions().Page, "page", "g", 0, "the page to retrieve (hidden)")
slurpCmd.Flags().Uint64VarP(&slurpPkg.GetOptions().PerPage, "per_page", "P", 3000, "the number of records to request on each page (hidden)")
slurpCmd.Flags().Float64VarP(&slurpPkg.GetOptions().Sleep, "sleep", "s", .25, "seconds to sleep between requests")
if os.Getenv("TEST_MODE") != "true" {
slurpCmd.Flags().MarkHidden("page")
slurpCmd.Flags().MarkHidden("per_page")
}
globals.InitGlobals("slurp", slurpCmd, &slurpPkg.GetOptions().Globals, capabilities)

slurpCmd.SetUsageTemplate(UsageWithNotes(notesSlurp))
Expand Down
3 changes: 0 additions & 3 deletions src/apps/chifra/internal/slurp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -46,7 +44,6 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
```

Data models produced by this tool:
Expand Down
10 changes: 10 additions & 0 deletions src/apps/chifra/pkg/config/notifyGroup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2021 The TrueBlocks Authors. All rights reserved.
// Use of this source code is governed by a license that can
// be found in the LICENSE file.

package config

type notifyGroup struct {
Url string `toml:"url" json:"url,omitempty"`
Author string `toml:"author" json:"author,omitempty"`
}
5 changes: 0 additions & 5 deletions src/apps/chifra/pkg/config/settingsGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ type settingsGroup struct {
Notify notifyGroup `toml:"notify"`
}

type notifyGroup struct {
Url string `toml:"url" json:"url,omitempty"`
Author string `toml:"author" json:"author,omitempty"`
}

func GetSettings() settingsGroup {
return GetRootConfig().Settings
}
5 changes: 2 additions & 3 deletions src/cmd-line-options.csv
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,14 @@ num,group,tags,api_route,tool,longName,hotKey,def_val,is_required,is_customizabl
12185,tools,Other,slurp,ethslurp,articulate,a,,false,false,true,true,gocmd,switch,<boolean>,articulate the retrieved data if ABIs can be found
12200,tools,Other,slurp,ethslurp,source,S,etherscan,false,false,true,true,gocmd,flag,enum[etherscan*|key],the source of the slurped data
12202,tools,Other,slurp,ethslurp,count,U,,false,false,true,true,gocmd,switch,<boolean>,for --appearances mode only&#44; display only the count of records
12203,tools,Other,slurp,ethslurp,page,g,0,false,false,true,true,gocmd,flag,<uint64>,the page to retrieve
12205,tools,Other,slurp,ethslurp,per_page,P,3000,false,false,true,true,gocmd,flag,<uint64>,the number of records to request on each page
12203,tools,Other,slurp,ethslurp,page,g,0,false,false,false,false,gocmd,flag,<uint64>,the page to retrieve
12205,tools,Other,slurp,ethslurp,per_page,P,3000,false,false,false,false,gocmd,flag,<uint64>,the number of records to request on each page
12210,tools,Other,slurp,ethslurp,sleep,s,.25,false,false,true,true,gocmd,flag,<double>,seconds to sleep between requests
12220,tools,Other,slurp,ethslurp,,,,false,false,true,true,--,description,,Fetch data from Etherscan for any address.
12222,tools,Other,slurp,ethslurp,n1,,,false,false,false,false,--,note,,An `address` must be either an ENS name or start with '0x' and be forty-two characters long.
12224,tools,Other,slurp,ethslurp,n2,,,false,false,false,false,--,note,,Portions of this software are Powered by Etherscan.io APIs.
12226,tools,Other,slurp,ethslurp,n3,,,false,false,false,false,--,note,,The withdrawals option is only available on certain chains. It is ignored otherwise.
12228,tools,Other,slurp,ethslurp,n4,,,false,false,false,false,--,note,,If the value of --source is key&#44; --types is ignored and only appearances or counts are returned.
12229,tools,Other,slurp,ethslurp,n4,,,false,false,false,false,--,note,,For --source = etherscan&#44; the --page option defaults to 1.

11660,dev_tools,,,makeClass,files,,,true,false,true,true,gocmd,positional,list<path>,one or more class definition files
11740,dev_tools,,,makeClass,all,a,,false,false,true,true,gocmd,switch,<boolean>,list&#44; or run all class definitions found in the local folder
Expand Down
5 changes: 2 additions & 3 deletions test/gold/apps/chifra/chifra_help_slurp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -33,4 +33,3 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_bad_source.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -37,5 +37,4 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.

5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_cache_and_decache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -39,5 +39,4 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.

5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_caps_allowed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -33,5 +33,4 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.

5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_caps_disallowed_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -33,5 +33,4 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.

5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -33,4 +33,3 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_help_long.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -33,4 +33,3 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.
5 changes: 2 additions & 3 deletions test/gold/tools/ethslurp/ethslurp_invalid_address.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Flags:
-S, --source string the source of the slurped data
One of [ etherscan | key ] (default "etherscan")
-U, --count for --appearances mode only, display only the count of records
-g, --page uint the page to retrieve
-P, --per_page uint the number of records to request on each page (default 3000)
-g, --page uint the page to retrieve (hidden)
-P, --per_page uint the number of records to request on each page (hidden) (default 3000)
-s, --sleep float seconds to sleep between requests (default 0.25)
-H, --ether specify value in ether
-w, --raw report JSON data from the source with minimal processing
Expand All @@ -35,5 +35,4 @@ Notes:
- Portions of this software are Powered by Etherscan.io APIs.
- The withdrawals option is only available on certain chains. It is ignored otherwise.
- If the value of --source is key, --types is ignored and only appearances or counts are returned.
- For --source = etherscan, the --page option defaults to 1.

0 comments on commit d1a3947

Please sign in to comment.