chore: remove useless
This commit is contained in:
@@ -349,9 +349,6 @@ func ParseTransaction(update *SubscribeUpdateTransaction, loader *AddressTables,
|
|||||||
case dflowProgramID:
|
case dflowProgramID:
|
||||||
txRes, err := parseDFlowInstruction(versioned, i)
|
txRes, err := parseDFlowInstruction(versioned, i)
|
||||||
parsed = appendParsed(now, parsed, txRes, err, txHash, "dflow", dflowProgramString)
|
parsed = appendParsed(now, parsed, txRes, err, txHash, "dflow", dflowProgramString)
|
||||||
case terminalProgramID:
|
|
||||||
txRes, err := parseTerminalInstruction(versioned, i)
|
|
||||||
parsed = appendParsed(now, parsed, txRes, err, txHash, "padre", terminalProgramIDString)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1653,25 +1650,6 @@ func parseFjszInstruction(tx *versionedTransaction, instructionIndex int) (*TxSi
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseTerminalInstruction(tx *versionedTransaction, instructionIndex int) (*TxSignal, error) {
|
|
||||||
msg := tx.Message
|
|
||||||
if instructionIndex >= len(msg.Instructions) {
|
|
||||||
return nil, fmt.Errorf("instruction index out of bounds")
|
|
||||||
}
|
|
||||||
|
|
||||||
instruction := msg.Instructions[instructionIndex]
|
|
||||||
if len(instruction.Data) == 0 {
|
|
||||||
return nil, fmt.Errorf("data is empty")
|
|
||||||
}
|
|
||||||
if matchMethod(instruction.Data, terminalBuyTokensIX) {
|
|
||||||
return parseTermBuy(tx, &instruction)
|
|
||||||
} else if matchMethod(instruction.Data, terminalSellTokensIX) {
|
|
||||||
return parseTermSell(tx, &instruction)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func matchMethod(data []byte, methods []byte) bool {
|
func matchMethod(data []byte, methods []byte) bool {
|
||||||
if len(data) < len(methods) {
|
if len(data) < len(methods) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user