Skip to content

Commit

Permalink
fix: getSlotValue test when node code
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Sep 18, 2023
1 parent 8aae4b4 commit 0b94b11
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions src/ts/__tests__/slotValues.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe('Slot Values', () => {
})
test('Emissions controller first slot latest', async () => {
expect(
await getSlotValue(url, emissionController, 1, '15272562')
await getSlotValue(url, emissionController, 1, '15272562'),
).toEqual(
'0x00000000000000000000000000000000000000000000000000000AB700000A96'
'0x00000000000000000000000000000000000000000000000000000AB700000A96',
)
})
test('Emissions controller first slot on deployment', async () => {
Expand All @@ -33,22 +33,20 @@ describe('Slot Values', () => {
url,
emissionController,
BigNumber.from(1),
13761579
)
13761579,
),
).toEqual(
'0x00000000000000000000000000000000000000000000000000000A9600000A96'
'0x00000000000000000000000000000000000000000000000000000A9600000A96',
)
})
test('Emissions controller first slot before deployment', async () => {
expect(
await getSlotValue(url, emissionController, 1, 13761570)
).toEqual(
'0x0000000000000000000000000000000000000000000000000000000000000000'
)
await expect(
getSlotValue(url, emissionController, 1, 13761570),
).rejects.toThrow(Error)
})
test('USDC second slot', async () => {
expect(await getSlotValue(url, usdc, 0, 'latest')).toEqual(
'0x000000000000000000000000FCB19E6A322B27C06842A71E8C725399F049AE3A'
'0x000000000000000000000000FCB19E6A322B27C06842A71E8C725399F049AE3A',
)
})
test('mUSD proxy admin slot', async () => {
Expand All @@ -57,10 +55,10 @@ describe('Slot Values', () => {
url,
musd,
'0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103',
'latest'
)
'latest',
),
).toEqual(
'0x0000000000000000000000005C8EB57B44C1C6391FC7A8A0CF44D26896F92386'
'0x0000000000000000000000005C8EB57B44C1C6391FC7A8A0CF44D26896F92386',
)
})
test('Emissions Controller batch', async () => {
Expand All @@ -77,7 +75,7 @@ describe('Slot Values', () => {
6,
'0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103',
],
'15272562'
'15272562',
)
console.log(values)
expect(values).toEqual([
Expand All @@ -96,7 +94,7 @@ describe('Slot Values', () => {
url,
emissionController,
[2, 1, 0],
'15272562'
'15272562',
)
console.log(values)
expect(values).toEqual([
Expand Down Expand Up @@ -196,9 +194,9 @@ describe('Slot Values', () => {
type,
slotValue: value,
dynamic,
})
}),
).toEqual(expected)
}
},
)
})
describe('escape string', () => {
Expand Down

0 comments on commit 0b94b11

Please sign in to comment.