Skip to content

Commit

Permalink
Merge pull request #52 from Reinis-FRP/reinis-frp/nested-bundles
Browse files Browse the repository at this point in the history
fix: preserve nested bundle key in mungers
  • Loading branch information
zeroXbrock committed Jan 11, 2024
2 parents 8970fe2 + 8037901 commit e67f7cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/mungers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export function mungePrivateTxParams(signedTx: string, options?: TransactionOpti
export function mungeBundleParams(params: BundleParams) {
type AnyBundleItem = {hash?: string, tx?: string, bundle?: any, canRevert?: boolean}
// recursively munge nested bundle params
const mungedBundle: any[] = params.body.map((i: AnyBundleItem) => i.bundle ? mungeBundleParams(i.bundle) : i)
const mungedBundle: any[] = params.body.map((i: AnyBundleItem) =>
i.bundle ? { bundle: mungeBundleParams(i.bundle) } : i
)
return {
...params,
body: mungedBundle,
Expand Down

0 comments on commit e67f7cf

Please sign in to comment.