Skip to content

feat: add wallet ffi function for arbitrary public transactions#429

Open
adklempner wants to merge 1 commit intologos-blockchain:mainfrom
adklempner:feat/wallet-ffi-send-public-transaction
Open

feat: add wallet ffi function for arbitrary public transactions#429
adklempner wants to merge 1 commit intologos-blockchain:mainfrom
adklempner:feat/wallet-ffi-send-public-transaction

Conversation

@adklempner
Copy link
Copy Markdown

Purpose

Add a generic FFI function for sending arbitrary public transactions to any deployed program, removing the need to add per-program FFI wrappers.

Related: #422

Approach

  • Add wallet_ffi_send_public_transaction C FFI function that accepts a program ID, account list, raw instruction bytes, and a signer
  • Add WalletCore::send_public_transaction async method that builds, signs, and submits a PublicTransaction
  • Add InvalidArgument error variant for input validation (e.g. instruction length not a multiple of 4)
  • Generate updated C header (wallet_ffi.h)

How to Test

  1. Build the wallet-ffi crate: cargo build -p wallet-ffi
  2. Call wallet_ffi_send_public_transaction from a logos-core module (see companion PR in logos-execution-zone-module)
  3. Verify the transaction is accepted by the sequencer and state is updated

Dependencies

None.

Future Work

PR Completion Checklist

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants