Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Automate Rust to C++ FFI #4220

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

[WIP]: Automate Rust to C++ FFI #4220

wants to merge 1 commit into from

Conversation

gupnik
Copy link
Collaborator

@gupnik gupnik commented Jan 17, 2025

Description

This PR intends to automate the rust to cpp conversion. It is broken down into the following tasks

  • Add a macro to auto-generate a yaml file for each class
  • Use the above yaml files to generate the respective C++ class

How to test

WIP

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • Create pull request as draft initially, unless its complete.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description.

If you're adding a new blockchain

  • I have read the guidelines for adding a new blockchain.

@gupnik
Copy link
Collaborator Author

gupnik commented Jan 17, 2025

Yaml file generated:

class: TWTONAddressConverter
static_functions:
- name: ToBoc
  rust_name: tw_ton_address_converter_to_boc
  args:
  - name: address
    ty: '* const TWString'
  return_type: '* mut TWString'
- name: FromBoc
  rust_name: tw_ton_address_converter_from_boc
  args:
  - name: boc
    ty: '* const TWString'
  return_type: '* mut TWString'
- name: ToUserFriendly
  rust_name: tw_ton_address_converter_to_user_friendly
  args:
  - name: address
    ty: '* const TWString'
  - name: bounceable
    ty: bool
  - name: testnet
    ty: bool
  return_type: '* mut TWString'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant