|
|
|
|
@@ -182,7 +182,8 @@ func ParseTransactionForEntries(ctx context.Context, slot uint64, entriesReader
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransaction, loader *AddressTables, parsed chan<- TxSignal, handlers map[solana.PublicKey]Handler) {
|
|
|
|
|
if loader != nil && len(versioned.AddressTableLookups) > 0 {
|
|
|
|
|
tableCnt := len(versioned.AddressTableLookups)
|
|
|
|
|
if loader != nil && tableCnt > 0 {
|
|
|
|
|
lookupTableOk := true
|
|
|
|
|
for _, lookups := range versioned.AddressTableLookups {
|
|
|
|
|
lookupTableOk = loader.FillToTx(&versioned, lookups.AccountKey, lookups.WritableIndexes)
|
|
|
|
|
@@ -203,22 +204,19 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|
|
|
|
cuPrice := decimal.Zero
|
|
|
|
|
swqosAgent := ""
|
|
|
|
|
swqosTips := decimal.Zero
|
|
|
|
|
cuLimit := decimal.Zero
|
|
|
|
|
cuLimit := uint32(0)
|
|
|
|
|
for _, instruction := range versioned.Instructions {
|
|
|
|
|
program, err := versioned.GetAccount(int(instruction.ProgramIDIndex))
|
|
|
|
|
if err != nil {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
if program.Equals(ComputeBudgetProgram) &&
|
|
|
|
|
len(instruction.Data) == 9 {
|
|
|
|
|
if instruction.Data[0] == 0x03 {
|
|
|
|
|
if program.Equals(ComputeBudgetProgram) {
|
|
|
|
|
if len(instruction.Data) == 9 && instruction.Data[0] == 0x03 {
|
|
|
|
|
cuPriceUint64 := binary.LittleEndian.Uint64(instruction.Data[1:9])
|
|
|
|
|
cuPrice = formatCUPrice(cuPriceUint64)
|
|
|
|
|
} else if instruction.Data[0] == 0x02 {
|
|
|
|
|
cuLimitUint32 := binary.LittleEndian.Uint32(instruction.Data[1:4])
|
|
|
|
|
cuLimit = formatCUPrice(uint64(cuLimitUint32))
|
|
|
|
|
} else if len(instruction.Data) == 5 && instruction.Data[0] == 0x02 {
|
|
|
|
|
cuLimit = binary.LittleEndian.Uint32(instruction.Data[1:5])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if program.Equals(solana.SystemProgramID) &&
|
|
|
|
|
len(instruction.Data) == 12 &&
|
|
|
|
|
@@ -269,6 +267,7 @@ func ParseTransactionWithHandler(ctx context.Context, versioned VersionedTransac
|
|
|
|
|
one.CULimit = cuLimit
|
|
|
|
|
one.SWQoSAgent = swqosAgent
|
|
|
|
|
one.SWQoSTips = swqosTips
|
|
|
|
|
one.TableCnt = tableCnt
|
|
|
|
|
select {
|
|
|
|
|
case <-ctx.Done():
|
|
|
|
|
return
|
|
|
|
|
|