Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
erokhinav committed Oct 9, 2024
1 parent e2da312 commit 42f0f52
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
28 changes: 14 additions & 14 deletions pkg/bath/stonfi.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,20 @@ var StonfiSwapV2Straw = Straw[BubbleJettonSwap]{
if body.QueryId > 0 && a.IsZero() && b.IsZero() {
return nil
}
//newAction.Out.Amount = big.Int(body.MinOut)
//s, err := tongo.AccountIDFromTlb(body.SenderAddress)
//if err != nil {
// return err
//}
//if s != nil && *s == b {
// a, b = b, a
//}
//newAction.In.JettonWallet = a
//newAction.Out.JettonWallet = b
//if tx.additionalInfo != nil {
// newAction.In.JettonMaster, _ = tx.additionalInfo.JettonMaster(a)
// newAction.Out.JettonMaster, _ = tx.additionalInfo.JettonMaster(b)
//}
newAction.Out.Amount = big.Int(body.DexPayload.SwapBody.MinOut)
s, err := tongo.AccountIDFromTlb(body.FromUser)
if err != nil {
return err
}
if s != nil && *s == b {
a, b = b, a
}
newAction.In.JettonWallet = a
newAction.Out.JettonWallet = b
if tx.additionalInfo != nil {
newAction.In.JettonMaster, _ = tx.additionalInfo.JettonMaster(a)
newAction.Out.JettonMaster, _ = tx.additionalInfo.JettonMaster(b)
}
return nil
},
SingleChild: &Straw[BubbleJettonSwap]{
Expand Down
1 change: 1 addition & 0 deletions pkg/bath/straws.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var DefaultStraws = []Merger{
WtonMintStraw,
NftPurchaseStraw,
StonfiSwapStraw,
StonfiSwapV2Straw,
DedustSwapJettonsStraw,
DedustSwapToTONStraw,
DedustSwapFromTONStraw,
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type STONfiPoolID struct {
type InformationSource interface {
JettonMastersForWallets(ctx context.Context, wallets []tongo.AccountID) (map[tongo.AccountID]tongo.AccountID, error)
NftSaleContracts(ctx context.Context, contracts []tongo.AccountID) (map[tongo.AccountID]NftSaleContract, error)
STONfiPools(ctx context.Context, poolIDs []tongo.AccountID) (map[tongo.AccountID]STONfiPool, error)
STONfiPools(ctx context.Context, poolIDs []STONfiPoolID) (map[tongo.AccountID]STONfiPool, error)
}

func isDestinationJettonWallet(inMsg *Message) bool {
Expand Down

0 comments on commit 42f0f52

Please sign in to comment.