all parser
This commit is contained in:
17
pump.go
17
pump.go
@@ -27,7 +27,6 @@ func pumpParser(tx *Tx, instruction Instruction, innerInstructions InnerInstruct
|
||||
|
||||
decode := instruction.Data
|
||||
if len(decode) < 8 {
|
||||
offset[1] += 1
|
||||
return nil, increaseOffset(offset), fmt.Errorf("pump program instruction data too short, offset, %d, %d", offset[0], offset[1])
|
||||
}
|
||||
|
||||
@@ -101,7 +100,7 @@ func CreateParser(tx *Tx, instr Instruction, innerInstructions InnerInstructions
|
||||
if offset[1] == 0 {
|
||||
offset[0] += 1
|
||||
} else {
|
||||
offset[1] += uint(innerIndex) + 1 + prefixLen
|
||||
offset[1] = uint(innerIndex) + 1 + prefixLen
|
||||
}
|
||||
if err != nil {
|
||||
return nil, offset, fmt.Errorf("pump create event decode error: %v, offset, %d, %d", err, offset[0], offset[1])
|
||||
@@ -470,12 +469,14 @@ func MigrateParser(tx *Tx, instr Instruction, innerInstructions InnerInstruction
|
||||
User: migrateEvent.User,
|
||||
//BaseAmount: decimal.Decimal{},
|
||||
//QuoteAmount: decimal.Decimal{},
|
||||
BaseReserve: decimal.NewFromUint64(migrateEvent.MintAmount),
|
||||
QuoteReserve: decimal.NewFromUint64(migrateEvent.SolAmount),
|
||||
Mayhem: createEvent.IsMayhemMode,
|
||||
UserBaseBalance: userBase,
|
||||
UserQuoteBalance: decimal.NewFromUint64(userQuote),
|
||||
EntryContract: entryContract,
|
||||
BaseReserve: decimal.NewFromUint64(migrateEvent.MintAmount),
|
||||
QuoteReserve: decimal.NewFromUint64(migrateEvent.SolAmount),
|
||||
Mayhem: createEvent.IsMayhemMode,
|
||||
MigrateTopProgram: pumpAmmProgram,
|
||||
MigrateToPool: migrateEvent.Pool,
|
||||
UserBaseBalance: userBase,
|
||||
UserQuoteBalance: decimal.NewFromUint64(userQuote),
|
||||
EntryContract: entryContract,
|
||||
},
|
||||
}
|
||||
swaps = append(swaps, Swap{
|
||||
|
||||
Reference in New Issue
Block a user