Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
273e87b8ad |
@@ -16,8 +16,8 @@ type metaoraPoolInitializePoolData struct {
|
||||
}
|
||||
|
||||
type metaoraPoolSwapArgs struct {
|
||||
InAmount uint64
|
||||
MinimumOutAmount uint64
|
||||
InAmount uint64
|
||||
MinimumOutAmount uint64
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -855,6 +855,9 @@ func metaoraPoolSwap(tx *Tx, instruction Instruction, innerInstructions InnerIns
|
||||
}
|
||||
}
|
||||
if !baseFound || !quoteFound {
|
||||
if args.InAmount == 0 {
|
||||
return nil, increaseOffset(offset), InstructionIgnoredError
|
||||
}
|
||||
return nil, increaseOffset(offset), fmt.Errorf("failed to find meteora pool event in inner instructions")
|
||||
}
|
||||
|
||||
|
||||
23
orcawhirpool_test.go
Normal file
23
orcawhirpool_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package pump_parser
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestOrcaWhirlpoolRemoveLiquidityPreservesLargeUint64TransferAmounts(t *testing.T) {
|
||||
EnableAllParsers()
|
||||
|
||||
tx := mustParseRPCFixtureTx(t, "4sj82GCLtgTDExq7B8YrBsrrqPcE4FqT5Y1gKWmE4cHMDxs7wkCV1hik73dSZ99gZm3K4wyBZQ6U8Nmf48rM9Jri")
|
||||
if len(tx.Swaps) == 0 {
|
||||
t.Fatal("expected parsed swaps")
|
||||
}
|
||||
|
||||
swap := tx.Swaps[0]
|
||||
if swap.Program != SolProgramOrcaWhirPool {
|
||||
t.Fatalf("program = %s, want %s", swap.Program, SolProgramOrcaWhirPool)
|
||||
}
|
||||
if swap.Event != TxEventRemoveLiquidity {
|
||||
t.Fatalf("event = %s, want %s", swap.Event, TxEventRemoveLiquidity)
|
||||
}
|
||||
|
||||
assertDecimalString(t, "base_amount", swap.BaseAmount, "101086439062")
|
||||
assertDecimalString(t, "quote_amount", swap.QuoteAmount, "9863327902766042414")
|
||||
}
|
||||
Reference in New Issue
Block a user