Skip to content

Commit

Permalink
Created SubmitTransaction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
silaslenihan committed Dec 3, 2024
1 parent 3749bbb commit e480515
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file added pkg/solana/chainwriter/__debug_bin2449797533
Binary file not shown.
12 changes: 6 additions & 6 deletions pkg/solana/chainwriter/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ func (s *SolanaChainWriterService) SubmitTransaction(ctx context.Context, contra
}
}

codec := s.codecs[contractName]
encodedPayload, err := codec.Encode(ctx, args, method)
if err != nil {
return errorWithDebugID(fmt.Errorf("error encoding transaction payload: %w", err), debugID)
}

// Fetch derived and static table maps
derivedTableMap, staticTableMap, err := s.ResolveLookupTables(ctx, args, methodConfig.LookupTables)
if err != nil {
Expand Down Expand Up @@ -234,12 +240,6 @@ func (s *SolanaChainWriterService) SubmitTransaction(ctx context.Context, contra
return errorWithDebugID(fmt.Errorf("error parsing fee payer address: %w", err), debugID)
}

codec := s.codecs[contractName]
encodedPayload, err := codec.Encode(ctx, args, method)
if err != nil {
return errorWithDebugID(fmt.Errorf("error encoding transaction payload: %w", err), debugID)
}

tx, err := solana.NewTransaction(
[]solana.Instruction{
solana.NewInstruction(programId, accounts, encodedPayload),
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/codec/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewNamedModifierCodec(original types.RemoteCodec, itemType string, modifier
return nil, err
}

_, err = modCodec.CreateType(itemType, true)
// _, err = modCodec.CreateType(itemType, true)

return modCodec, err
}
Expand Down

0 comments on commit e480515

Please sign in to comment.