Skip to content

Conversation

hewigovens
Copy link
Contributor

@hewigovens hewigovens commented Feb 23, 2019

Description

Fix #6, we only support non negative / float XRP payment transaction from A to B.

Reference:

Testing instructions

All ripple UT passed

Types of changes

  • Add Transaction, Signer and TWRippleSigner

Checklist

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.

}

/// Encodes a 64-bit value into the provided buffer.
static inline void encode64(uint64_t val, std::vector<uint8_t>& data) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should consolidate this and the one under Bitcoin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the only difference is endian?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, let's have something like encode64le and encode64be

namespace TW {
namespace Ripple {

enum FieldType: int {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is only used in C++ let's use class enum FieldType: int and change enum cases to just the name like int16

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

};

enum TransactionType {
TransactionTypePayment = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here


/// Encodes a field type.
static inline void encodeType(FieldType type, int key, std::vector<uint8_t>& data) {
int _type = int(type);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
int _type = int(type);
const auto typeValue = static_cast<int>(type);

@hewigovens hewigovens merged commit c2308ea into master Feb 24, 2019
@hewigovens hewigovens deleted the xt/ripple-tx branch February 24, 2019 02:38
hewigovens added a commit that referenced this pull request Feb 26, 2019
* Add ripple tx serialization

* rebase master

* add TWRippleSigner and tests

* continue adding

* update java_package

* Add xrp/wan/vet logo

* use enum class

* use static_cast
zkrypt-crossbar pushed a commit to Cramiumlabs/wallet-core that referenced this pull request Jun 15, 2025
* Add ripple tx serialization

* rebase master

* add TWRippleSigner and tests

* continue adding

* update java_package

* Add xrp/wan/vet logo

* use enum class

* use static_cast
zkrypt-crossbar pushed a commit to Cramiumlabs/wallet-core that referenced this pull request Jun 21, 2025
* Add ripple tx serialization

* rebase master

* add TWRippleSigner and tests

* continue adding

* update java_package

* Add xrp/wan/vet logo

* use enum class

* use static_cast
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.

Add support for Ripple
2 participants