Skip to content

Implement more comprehensive TransactionFlag checks in each Transaction builder #691

@sappenin

Description

@sappenin

We should implement more comprehensive flag checks as preconditions in each Transaction builder.

For example, #690 introduce the ability to get TransactionFlags from the Transaction interface. To be fully correct, we would want to add precondition checks to each Transaction sub-class to make sure that transactions with the tfInnerTransaction flag didn't also include a signature, like this:

 @Value.Check
  default void vaidateInner(){
    if (flags().tfInnerBatchTxn()) {
      Preconditions.checkArgument(this.transactionSignature().isEmpty(),
        "Inner transaction must not have a transaction signature."
      );
      Preconditions.checkArgument(this.signingPublicKey().equals(PublicKey.EMPTY_PUBLIC_KEY),
        "Inner transaction must not have a signing public key."
      );
    }
  }

In addition, there are other flag checks that we might want to introduce additional checks around flags that are not allowed in OfferCreate. See the checks in xrpl-js for VaultCreate or the checks in NFTokenCreateOffers where xrpl-js checks certain conditions that xrpl4j does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions