Skip to content

Commit

Permalink
Fix/invalid param names (#122)
Browse files Browse the repository at this point in the history
* Fix: invalid param names

* chore: changeset

* chore: format

* chore: delete test

* Revert "chore: delete test"

This reverts commit f722419.

* chore: remove test

---------

Co-authored-by: maxencerb <[email protected]>
  • Loading branch information
maxencerb and maxencerb authored Aug 13, 2024
1 parent eae01e5 commit c88d3a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-gifts-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mangrovedao/mgv": patch
---

Fix invalid param names on kandel
29 changes: 18 additions & 11 deletions src/builder/kandel/populate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const populateABI = parseAbi([
])

export type PopulateFromOffsetParams = {
from?: bigint | undefined
to?: bigint | undefined
fromIndex?: bigint | undefined
toIndex?: bigint | undefined
baseQuoteTickIndex0: bigint
baseQuoteTickOffset: bigint
firstAskIndex: bigint
Expand All @@ -23,8 +23,8 @@ export type PopulateFromOffsetParams = {
quoteAmount?: bigint | undefined
}
export type PopulateChunkFromOffsetParams = {
from?: bigint | undefined
to: bigint
fromIndex?: bigint | undefined
toIndex: bigint
baseQuoteTickIndex0: bigint
firstAskIndex: bigint
bidGives: bigint
Expand All @@ -40,8 +40,8 @@ export function populateFromOffsetParams(params: PopulateFromOffsetParams) {
gasreq,
pricePoints,
stepSize,
from = 0n,
to = pricePoints,
fromIndex = 0n,
toIndex = pricePoints,
baseAmount = 0n,
quoteAmount = 0n,
gasprice = 0n,
Expand All @@ -50,8 +50,8 @@ export function populateFromOffsetParams(params: PopulateFromOffsetParams) {
abi: populateABI,
functionName: 'populateFromOffset',
args: [
from,
to,
fromIndex,
toIndex,
baseQuoteTickIndex0,
baseQuoteTickOffset,
firstAskIndex,
Expand Down Expand Up @@ -84,13 +84,20 @@ export function populateChunkFromOffsetParams(
firstAskIndex,
bidGives,
askGives,
from = 0n,
to,
fromIndex = 0n,
toIndex,
} = params
return {
abi: populateABI,
functionName: 'populateChunkFromOffset',
args: [from, to, baseQuoteTickIndex0, firstAskIndex, bidGives, askGives],
args: [
fromIndex,
toIndex,
baseQuoteTickIndex0,
firstAskIndex,
bidGives,
askGives,
],
} satisfies Omit<
ContractFunctionParameters<
typeof populateABI,
Expand Down

0 comments on commit c88d3a1

Please sign in to comment.