Skip to content

Commit

Permalink
Merge pull request #2 from XRPLWin/dev
Browse files Browse the repository at this point in the history
Hook position tracking
  • Loading branch information
zgrguric authored Feb 9, 2024
2 parents 603e811 + 5a52b58 commit 5375b15
Show file tree
Hide file tree
Showing 20 changed files with 1,095 additions and 119 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,24 @@ $isDestroyed = $TxHookParser->isHookDestroyed('5EDF6...2DC77');

# List of uninstalled hooks* (eg. SetHook transaction)
$uninstalledHooks = $TxHookParser->uninstalledHooks();
# List of uninstalled hooks with positions*
$uninstalledHooksPos = $TxHookParser->uninstalledHooksPos();
# List of uninstalled hooks with num uninstalls
$uninstalledHooksStats = $TxHookParser->uninstalledHooksStats();
# List of installed hooks* (eg. SetHook transaction)
$installedHooks = $TxHookParser->installedHooks();
# List of installed hooks with positions*
$installedHooksPos = $TxHookParser->installedHooksPos();
# List of installed hooks with num installs
$installedHooksStats = $TxHookParser->installedHooksStats();
# List of modified hooks*
$modifiedHooks = $TxHookParser->modifiedHooks();

# List of modified hooks with positions*
$modifiedHooksPos = $TxHookParser->modifiedHooksPos();
# List of unmodified hooks*
$unmodifiedHooks = $TxHookParser->unmodifiedHooks();
# List of unmodified hooks with positions*
$unmodifiedHooksPos = $TxHookParser->unmodifiedHooksPos();
# Manual data lookup (lookup any combination of mapped data)
$lookup = $TxHookParser->lookup('raddress...','Hook','installed');

Expand Down Expand Up @@ -121,6 +130,22 @@ HookOn::encode([HookOn::ttACCOUNT_DELETE,HookOn::ttACCOUNT_SET]);
//= (string)'0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9ffff7'
```

## What is new in version 2.x
Version 2.x brings overhaul of hook detection code and now
positions are tracked, which in return allows new methods
listed below. For each installed, modified and uninstalled
hook on account it is possible to get position in which change
was occured. Modified Hooks method now does not return hooks
which was reinstalled but contents are not changed (Flag=0 is normalized),
those are now available in `unmodifiedHooks` and `unmodifiedHooksPos` methods.

- Added `uninstalledHooksPos()` method
- Added `installedHooksPos()` method
- Changed `modifiedHooks()` method
- Added `modifiedHooksPos()` method
- Added `unmodifiedHooks()` method
- Added `unmodifiedHooksPos()` method

## Running tests
Run all tests in "tests" directory.
```
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />
</php>
</phpunit>
Loading

0 comments on commit 5375b15

Please sign in to comment.