plugeth/plugins/test-plugin
2023-10-23 17:40:33 -07:00
..
test Misc. Fixes from code review 2023-10-02 14:45:41 -05:00
engine.go Misc. Fixes from code review 2023-10-02 14:45:41 -05:00
genesis.go Misc. Fixes from code review 2023-10-02 14:45:41 -05:00
hooks.go Added OpCodeSelect() to test plugin 2023-10-23 17:40:33 -07: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 OpCodeSelect() to test plugin 2023-10-23 17:40:33 -07: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.