plugeth/plugins/test-plugin
2024-02-28 14:39:02 -08:00
..
test Merged Use the statedb database to get Tries PR into merge PR 2024-01-24 14:55:49 -08:00
engine.go Added psudoCreateEngine function to test CreateEngine call 2023-12-04 09:46:30 -08:00
genesis.go Misc. Fixes from code review 2023-10-02 14:45:41 -05:00
hooks.go Added IsShanghai to test, increased size of hookChan in test to occomodate. 2024-02-20 13:17:11 -08:00
live_tracer.go This is a functional build a dev tagged release of foundation plugeth 2023-07-13 13:10:19 -07:00
main.go Added IsShanghai to test, increased size of hookChan in test to occomodate. 2024-02-20 13:17:11 -08:00
README.md This is a functional build a dev tagged release of foundation plugeth 2023-07-13 13:10:19 -07:00
shutdown.go This is a functional build a dev tagged release of foundation plugeth 2023-07-13 13:10:19 -07:00
tracer.go This is a functional build a dev tagged release of foundation plugeth 2023-07-13 13:10:19 -07:00

Plugeth Test Plugin

This plugin works in a very similar fashion as the Consensus Engine plugin. There is a bash script, ./test/run-test.sh which instantiates three individual nodes which execute a pseudo blockchain. Throughout the execution of the chain many of the PluGeth hooks and injections are engaged which in turn trigger pluginBlockChain() to track the invoked methods and complain if any are not called. Thus we can confirm that the PluGeth application is fully implemented on the target client.

In order to use the plugin navigate to the /test/ directory. Change the permissions on run-test.sh to enable execution. Then point the executable geth file to a Geth binary like so: $ /path/to/geth/geth ./run-test.sh . The test takes roughly 4.5 mins to run. If successful it should close with an exit code of 0.

There are four methods not covered by testing at this time: LiveCaptureFault(), LiveCaptureEnter(), LiveCaptureExit(), LiveTracerResult(). Also, there are several injections which fall outside of the testing parameters of this application: ./core/ NewSideBlock(), Reorg(), BlockProcessingError(), ./core/rawdb/ ModifyAncients(), AppendAncient(). These are covered by stand alone standard go tests which can all be run by navigating to the respective directories and running: go test -v -run TestPlugethInjections.

Note: depending on where the script is deployed Geth may complain that the path to the .ipc file is too long. Renaming of the directories or moving the project may be necessary.