Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(titles): fix failing simulate mint test #512

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/moody-moose-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-titles": patch
---

fix failing tests for titles simulateMint
32 changes: 4 additions & 28 deletions packages/titles/src/Titles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,35 +137,11 @@ describe('Given the getFee function', () => {
describe('simulateMint function', () => {
test('should simulate a V2 mint', async () => {
const contractAddress: Address =
'0x432f4Ccc39AB8DD8015F590a56244bECb8D16933'
'0xc1eee0e85cf2356357ccad2cd1a60a5935538e4d'
const mintParams = {
contractAddress,
chainId: Chains.BASE,
tokenId: 4,
recipient: '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF',
}
const value = parseEther('0.0005')
const address = mintParams.recipient as Address

const result = await simulateMint(
mintParams as MintIntentParams,
value,
address,
)

const request = result.request
expect(request.address).toBe('0x432f4Ccc39AB8DD8015F590a56244bECb8D16933')
expect(request.functionName).toBe('mint')
expect(request.value).toBe(value)
})

test('should simulate a V2 mint', async () => {
const contractAddress: Address =
'0x06d7D870a41a44B5b7eBF46019bD5f8487362de3'
const mintParams = {
contractAddress,
chainId: Chains.BASE,
tokenId: 5,
chainId: Chains.ZORA,
tokenId: 1,
recipient: '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF',
}
const value = parseEther('0.0005')
Expand All @@ -178,7 +154,7 @@ describe('simulateMint function', () => {
)

const request = result.request
expect(request.address).toBe('0x06d7D870a41a44B5b7eBF46019bD5f8487362de3')
expect(request.address).toBe('0xc1eee0e85cf2356357ccad2cd1a60a5935538e4d')
expect(request.functionName).toBe('mint')
expect(request.value).toBe(value)
})
Expand Down
Loading