Skip to content

Commit

Permalink
improve test names and remove duplicated test
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-james committed Jun 22, 2024
1 parent d744884 commit 7ad26be
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.lmax.solana4j.encoding;

import com.lmax.solana4j.Solana;
import com.lmax.solana4j.api.ProgramDerivedAddress;
import com.lmax.solana4j.api.PublicKey;
import com.lmax.solana4j.api.Slot;
import com.lmax.solana4j.programs.AddressLookupTableProgram;
import org.assertj.core.api.AssertionsForClassTypes;
import org.bitcoinj.core.Base58;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -43,20 +39,4 @@ void shouldCalculateAProgramDerivedAddressFromMultipleSeeds()
AssertionsForClassTypes.assertThat(programDerivedAddress.address().base58()).isEqualTo("FiZFCNEX1WJbP1UEyr2o4uyhtEFoZc3cMyYScf6LAYDx");
AssertionsForClassTypes.assertThat(programDerivedAddress.nonce()).isEqualTo(254);
}

@Test
void shouldCalculateAProgramDerivedAddressForAddressLookupTable()
{
final PublicKey authority = Solana.account(Base58.decode("EYB1g5R8beNtVqDpKpmkKWtLdhBY8Wh7q3QT3U3fbw7y"));

final Slot recentSlot = Solana.slot(265008810);

final ProgramDerivedAddress programDerivedAddress = SolanaProgramDerivedAddress.deriveProgramAddress(
List.of(authority.bytes(), recentSlot.bytes()),
AddressLookupTableProgram.PROGRAM_ACCOUNT
);

assertThat(programDerivedAddress.address().base58()).isEqualTo("DmTtM8rQMcqR56ksBkayLd9KuYiFaGYZEAPnh5iUtgVV");
assertThat(programDerivedAddress.nonce()).isEqualTo(255);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class AddressLookupTableProgramTest
{
@Test
void derivesCorrectAddressLookupAddressAndBumpSeed()
void derivesCorrectProgramDerivedAddressForAddressLookupTableProgram()
{
final PublicKey authority = Solana.account(Base58.decode("EYB1g5R8beNtVqDpKpmkKWtLdhBY8Wh7q3QT3U3fbw7y"));
final ProgramDerivedAddress programDerivedAddress = AddressLookupTableProgram.deriveAddress(authority, Solana.slot(265008810));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class AssociatedTokenMetadataProgramTest
{
@Test
void derivesCorrectTokenMetadataProgramAddress()
void derivesCorrectProgramDerivedAddressForTokenMetadataProgram()
{
final PublicKey mint = Solana.account(Base58.decode("HDLRMKW1FDz2q5Zg778CZx26UgrtnqpUDkNNJHhmVUFr"));
final ProgramDerivedAddress metadataAddress = AssociatedTokenMetadataProgram.deriveAddress(mint);
Expand Down

0 comments on commit 7ad26be

Please sign in to comment.