Commit Graph

796 Commits

Author SHA1 Message Date
M. J. Fromberger
46c232b7f5 Drop the test data file. 2021-08-27 14:49:21 -07:00
M. J. Fromberger
8ecffafc31 Compact test data; add more repeat cases. 2021-08-27 14:39:40 -07:00
M. J. Fromberger
ced2ebc437 Give block_id a consistent name 2021-08-27 14:39:26 -07:00
M. J. Fromberger
c10c12076e Add a test for events with repeated keys 2021-08-27 14:33:08 -07:00
M. J. Fromberger
6944ae82c6 Correctly index meta-events. 2021-08-27 13:58:38 -07:00
M. J. Fromberger
466231e4d6 Include creation time in the tx_event view 2021-08-27 13:47:28 -07:00
M. J. Fromberger
d95368f11e Rename the debuf flag -pause-at-exit 2021-08-27 13:47:07 -07:00
M. J. Fromberger
ce05cb67ac Fix indexing of duplicate transactions. 2021-08-27 13:46:32 -07:00
M. J. Fromberger
06849c72e1 Fix an overly-broad query. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
81c6363b20 More uses of verifyNotImplemented. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
13572b4dca Remove per-test setup and teardown 2021-08-27 13:18:31 -07:00
M. J. Fromberger
600147a5fc Make chainID a const 2021-08-27 13:18:31 -07:00
M. J. Fromberger
01f4846518 Implement a custom TestMain function.
This avoids having to set up and tear down the database multiple times.
That in turn is necessary so that we don't discard data we need to test.
2021-08-27 13:18:31 -07:00
M. J. Fromberger
217b411753 Fix placeholders. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
dd9823274c Fix a test result 2021-08-27 13:18:31 -07:00
M. J. Fromberger
9a621d434b Add a -debug flag to the test for manual inspection 2021-08-27 13:18:31 -07:00
M. J. Fromberger
701e9329ea Fix INSERT queries that need to report an ID. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
fdcfac75c8 Fix PostgreSQL placeholders. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
d97babae16 WIP: update tests further 2021-08-27 13:18:31 -07:00
M. J. Fromberger
da3af7e401 Fix SQL placeholders for PostgreSQL. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
50a23cb6b4 Some minor readability fixes. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
3b441e1751 Fix an assertion typo. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
1d99e08ef3 Add comments. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
35bffbd9c4 Rework the main test to use helpers. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
63be659f80 Add constants for the events views. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
91d9b67063 Remove an(other) unnecessary import alias. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
6995e1d18a Clean up schema reading. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
4a1358ea5a Defer pool teardowns so it's easier to be sure they happen. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
309fd9abde Get rid of an unnecessary temporary. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
87834e1ec7 Rework setup and teardown as must functions. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
31491dc80f Remove an unnecessary import alias. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
cb70f03523 WIP update verifyTimeStamp 2021-08-27 13:18:31 -07:00
M. J. Fromberger
5e11a581a0 WIP: Start updating tests 2021-08-27 13:18:31 -07:00
M. J. Fromberger
f1cdb4341d WIP: add schema test data (do not merge) 2021-08-27 13:18:31 -07:00
M. J. Fromberger
ee06c99e20 WIP: update for new schema, builds but untested 2021-08-27 13:18:31 -07:00
M. J. Fromberger
b62e185578 WIP: start rewriting queries 2021-08-27 13:18:31 -07:00
M. J. Fromberger
2351d3da61 Unexport database constants. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
615164ed57 Make constants const. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
11c92ec4e2 Put side-effecting imports in their own section 2021-08-27 13:18:31 -07:00
M. J. Fromberger
33401d8703 Move the interface satisfaction test to the test. 2021-08-27 13:18:31 -07:00
M. J. Fromberger
b9aebac17b WIP: schema changes (not ready) 2021-08-27 13:18:31 -07:00
M. J. Fromberger
41a361ed8d psql: add documentation and simplify constructor API (#6856)
Add documentation comments to the psql event sink package, and simplify the
constructor function so that it does not return the SQL database handle.  The
handle is needed for testing, so expose that via a separate method on the
concrete type.

Update the tests and existing usage for the change. This change does not affect
the behaviour of the sink, so there are no functional changes, only syntactic
updates.
2021-08-24 17:18:27 -04:00
William Banfield
bc2b529b95 inspect: add inspect mode for debugging crashed tendermint node (#6785)
EDIT: Updated, see [comment below]( https://github.com/tendermint/tendermint/pull/6785#issuecomment-897793175)

This change adds a sketch of the `Debug` mode. 

This change adds a `Debug` struct to the node package. This `Debug` struct is intended to be created and started by a command in the `cmd` directory. The `Debug` struct runs the RPC server on the data directories: both the state store and the block store.

This change required a good deal of refactoring. Namely, a new `rpc.go` file was added to the `node` package. This file encapsulates functions for starting RPC servers used by nodes. A potential additional change is to further factor this code into shared code _in_ the `rpc` package. 

Minor API tweaks were also made that seemed appropriate such as the mechanism for fetching routes from the `rpc/core` package.

Additional work is required to register the `Debug` service as a command in the `cmd` directory but I am looking for feedback on if this direction seems appropriate before diving much further.

closes: #5908
2021-08-24 18:12:06 +00:00
Sam Kleinman
d7c3a8f682 time: make median time library type private (#6853)
This is a very minor change, but I was looking through the code, and
this seems like it shouldn't be exported or used more broadly, so I've
moved it out.
2021-08-24 15:43:13 +00:00
Aleksandr Bezobchuk
cce0a3c171 docs: add package godoc for indexer (#6839)
* docs: add indexer godoc

* docs++

* docs++

* docs++

* docs++

* docs++

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Update state/indexer/doc.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* docs++

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-08-19 20:25:17 +00:00
William Banfield
4e96c6b234 tools: add mockery to tools.go and remove mockery version strings (#6787)
This change aims to keep versions of mockery consistent across developer laptops.

This change adds mockery to the `tools.go` file so that its version can be managed consistently in the `go.mod` file.

Additionally, this change temporarily disables adding mockery's version number to generated files. There is an outstanding issue against the mockery project related to the version string behavior when running from `go get`. I have created a pull request to fix this issue in the mockery project.
see: https://github.com/vektra/mockery/issues/397
2021-07-30 20:47:15 +00:00
Callum Waters
02f8e4c0bd blockstore: fix problem with seen commit (#6782) 2021-07-30 17:37:04 +02:00
M. J. Fromberger
6dd8984fef Fix and clarify breaks from select cases. (#6781)
Update those break statements inside case clauses that are intended to reach an
enclosing for loop, so that they correctly exit the loop.

The candidate files for this change were located using:

    % staticcheck -checks SA4011 ./... | cut -d: -f-2

This change is intended to preserve the intended semantics of the code, but
since the code as-written did not have its intended effect, some behaviour may
change. Specifically: Some loops may have run longer than they were supposed
to, prior to this change.

In one case I was not able to clearly determine the intended outcome. That case
has been commented but otherwise left as-written.

Fixes #6780.
2021-07-29 22:28:32 -04:00
M. J. Fromberger
8f06e0c9e7 cleanup: remove redundant error plumbing (#6778)
This is a mostly-automated fixup using Comby (https://comby.dev) to remove 
lexically-obvious redundant error checks. No functional changes are intended.

To reproduce the core change:

    # Collapse redundant error check conditionals
    % comby -in-place 'if err != nil {
       return err
    }
    return nil' 'return err' .go

    # Fold out unnecessary error temporaries
    % comby -in-place ':[spc~^\s*]err :[~:?]= :[any]
       return err' ':[spc]return :[any]' .go

Fixes #6479 and related cases.
2021-07-28 15:38:46 -04:00
JayT106
e87b0391cb cli/indexer: Reindex events (#6676) 2021-07-28 00:04:54 +02:00