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

There is a typo in Transaction.isSorobanData. #517

Closed
overcat opened this issue Aug 30, 2023 · 1 comment
Closed

There is a typo in Transaction.isSorobanData. #517

overcat opened this issue Aug 30, 2023 · 1 comment
Labels

Comments

@overcat
Copy link
Member

overcat commented Aug 30, 2023

What version are you using?

0.41.0-beta.2

What did you do?

  @Test
  public void testIsSorobanTransactionBumpFootprintExpirationOperation() {
    KeyPair source =
        KeyPair.fromSecretSeed("SCH27VUZZ6UAKB67BDNF6FA42YMBMQCBKXWGMFD5TZ6S5ZZCZFLRXKHS");

    Account account = new Account(source.getAccountId(), 2908908335136768L);
    String contractId = "CDYUOBUVMZPWIU4GB4XNBAYL6NIHIMYLZFNEXOCDIO33MBJMNPSFBYKU";
    SorobanTransactionData sorobanData =
        new SorobanDataBuilder()
            .setReadOnly(
                Collections.singletonList(
                    new LedgerKey.Builder()
                        .discriminant(LedgerEntryType.CONTRACT_DATA)
                        .contractData(
                            new LedgerKey.LedgerKeyContractData.Builder()
                                .contract(new Address(contractId).toSCAddress())
                                .key(Scv.toLedgerKeyContractInstance())
                                .durability(ContractDataDurability.PERSISTENT)
                                .bodyType(ContractEntryBodyType.DATA_ENTRY)
                                .build())
                        .build()))
            .build();
    BumpFootprintExpirationOperation operation =
        BumpFootprintExpirationOperation.builder().ledgersToExpire(4096L).build();
    Transaction transaction =
        new Transaction(
            AccountConverter.enableMuxed(),
            account.getAccountId(),
            Transaction.MIN_BASE_FEE,
            account.getIncrementedSequenceNumber(),
            new org.stellar.sdk.Operation[] {operation},
            null,
            new TransactionPreconditions(
                null, null, BigInteger.ZERO, 0, new ArrayList<SignerKey>(), null),
            sorobanData,
            Network.TESTNET);
    assertTrue(transaction.isSorobanTransaction());
  }

What did you expect to see?

the above test passed

What did you see instead?

the above test failed

Note

This is because BumpSequenceOperation should be changed to BumpFootprintExpirationOperation.

https://github.com/stellar/java-stellar-sdk/blob/d6379e961557ac3d86609c26141d2c0dad376ac3/src/main/java/org/stellar/sdk/Transaction.java#L405

@overcat
Copy link
Member Author

overcat commented Sep 4, 2023

fixed in #518

@overcat overcat closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant