Skip to content

Commit

Permalink
convenience Discriminator Instruction factory method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Aug 15, 2024
1 parent 4af96d8 commit b0f68cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/java/software/sava/core/tx/Instruction.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import software.sava.core.accounts.PublicKey;
import software.sava.core.accounts.lookup.AccountIndexLookupTableEntry;
import software.sava.core.accounts.meta.AccountMeta;
import software.sava.core.programs.Discriminator;

import java.util.Collection;
import java.util.List;
Expand All @@ -23,6 +24,12 @@ static Instruction createInstruction(final AccountMeta programId,
return createInstruction(programId, keys, data, 0, data.length);
}

static Instruction createInstruction(final AccountMeta programId,
final List<AccountMeta> keys,
final Discriminator discriminator) {
return createInstruction(programId, keys, discriminator.data());
}

static Instruction createInstruction(final PublicKey programId,
final List<AccountMeta> keys,
final byte[] data, int offset, int len) {
Expand Down

0 comments on commit b0f68cd

Please sign in to comment.