Skip to content

prepare Hook API#413

Merged
RichardAH merged 73 commits intoXahau:devfrom
tequdev:prepare-hook-api
Feb 17, 2026
Merged

prepare Hook API#413
RichardAH merged 73 commits intoXahau:devfrom
tequdev:prepare-hook-api

Conversation

@tequdev
Copy link
Member

@tequdev tequdev commented Dec 18, 2024

High Level Overview of Change

require

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@tequdev
Copy link
Member Author

tequdev commented Dec 20, 2024

#include "hookapi.h"

extern int64_t prepare(uint32_t write_ptr, uint32_t write_len,
                       uint32_t read_ptr, uint32_t read_len);

uint8_t txn[1024] = {0x12, 0x00, ttACCOUNT_SET};
uint8_t txn_out[1024];

int64_t hook(uint32_t reserved) {
  etxn_reserve(1);

  uint32_t txn_out_len = prepare(SBUF(txn_out), txn, 3);

  ASSERT(txn_out_len > 0);

  uint8_t hash[32];
  ASSERT(emit(SBUF(hash), txn_out, txn_out_len) > 0);

  _g(1, 1);
  accept(SBUF("success"), __LINE__);
  return 0;
}

@tequdev tequdev changed the title prepare Hook API [DO NOT MERGE] prepare Hook API Feb 14, 2025
@tequdev tequdev added the feature Feature Request label Mar 4, 2025
@tequdev tequdev force-pushed the prepare-hook-api branch from 3a8297e to 66d2a64 Compare July 14, 2025 07:40
tar -xf clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz
sudo mv clang+llvm-10.0.1-x86_64-linux-gnu-ubuntu-16.04 /opt/clang-10
sudo ln -s /opt/clang-10/bin/clang-format /usr/local/bin/clang-format-10

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you intending to change the workflow in this commit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change itself was actually implemented in this prerequisite PR.

It's been updated to generate the extern.h based on hookapi.macro and then apply clang-format.

#622

@RichardAH RichardAH merged commit efd5f9f into Xahau:dev Feb 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Feature Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants