Skip to content

Commit

Permalink
add flags test
Browse files Browse the repository at this point in the history
  • Loading branch information
nkramer44 committed Nov 4, 2024
1 parent 29e3f04 commit ea26ff0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.xrpl.xrpl4j.model.transactions;

import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
Expand All @@ -26,12 +28,13 @@ void testJson() throws JSONException, JsonProcessingException {
unknownFields.put("NFTokenMinter", "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn");
unknownFields.put("WalletLocator", Strings.repeat("0", 64));
unknownFields.put("EmailHash", Strings.repeat("0", 32));
Transaction transaction = UnknownTransaction.builder()
TransactionFlags flags = TransactionFlags.of(2147483648L);
UnknownTransaction transaction = UnknownTransaction.builder()
.unknownTransactionType("AccountSet2")
.account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"))
.fee(XrpCurrencyAmount.ofDrops(12))
.sequence(UnsignedInteger.valueOf(5))
.flags(TransactionFlags.of(2147483648L))
.flags(flags)
.signingPublicKey(
PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC"))
.unknownFields(
Expand All @@ -40,6 +43,8 @@ void testJson() throws JSONException, JsonProcessingException {
.networkId(NetworkId.of(UnsignedInteger.valueOf(1024)))
.build();

assertThat(transaction.flags()).isEqualTo(flags);

// Same properties as AccountSet, but TransactionType is AccountSet2
String json = "{\n" +
" \"TransactionType\":\"AccountSet2\",\n" +
Expand Down

0 comments on commit ea26ff0

Please sign in to comment.