Skip to content

Commit

Permalink
refactor(chatffi): remove c rep types (#5829)
Browse files Browse the repository at this point in the history
Description
---
- Remove the c rep types so clients don't have to deal with unsafe
mutable pointers. It keeps the types used within chat consistent and
creates far less duplication of the same data in different wrappers.
- Update documentation
- Update function and type names
- Try and use better aligned int types. In Rust if we want a u8 we
should request a c_uchar. i64 should be a u_longlong. Previously most
types were being casted down to c_int or c_uint (i32, u32). This
presented a probability for casting problems later on.

Motivation and Context
---
Removing the creps is to help with overall library consistency. The rest
of the changes are improvements for ease of use.

How Has This Been Tested?
---
- CI
- Cucumber
- New unit tests added

What process can a PR reviewer use to test or verify this change?
---
See if the changes make sense. Does the library architecture make sense
to you, could you use it?

Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify
  • Loading branch information
brianp authored Oct 20, 2023
1 parent 24403b6 commit 6e52f44
Show file tree
Hide file tree
Showing 28 changed files with 1,557 additions and 770 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion base_layer/chat_ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"

[dependencies]
minotari_app_utilities = { path = "../../applications/minotari_app_utilities" }
tari_chat_client = { path = "../contacts/examples/chat_client" }
tari_chat_client = { path = "../contacts/src/chat_client" }
tari_common = { path = "../../common" }
tari_common_types = { path = "../common_types" }
tari_contacts = { path = "../contacts" }
Expand All @@ -29,6 +29,9 @@ openssl = { version = "0.10.55", features = ["vendored"] }
[lib]
crate-type = ["staticlib","cdylib"]

[dev-dependencies]
chrono = { version = "0.4.19", default-features = false }

[build-dependencies]
cbindgen = "0.24.3"
tari_common = { path = "../../common", features = ["build", "static-application-info"] }
Expand Down
Loading

0 comments on commit 6e52f44

Please sign in to comment.