updating test
This commit is contained in:
parent
96d5b0a435
commit
4ae6e76190
|
@ -43,7 +43,7 @@ const minAbi = [
|
||||||
}
|
}
|
||||||
] as AbiItem[]
|
] as AbiItem[]
|
||||||
|
|
||||||
describe('veOcean tests', async () => {
|
describe('Delegation tests', async () => {
|
||||||
let veOcean: VeOcean
|
let veOcean: VeOcean
|
||||||
let ownerAccount: string
|
let ownerAccount: string
|
||||||
let Alice: string
|
let Alice: string
|
||||||
|
@ -141,17 +141,12 @@ describe('veOcean tests', async () => {
|
||||||
|
|
||||||
const lockTime = await veOcean.lockEnd(Alice)
|
const lockTime = await veOcean.lockEnd(Alice)
|
||||||
const extLockTime = Number(lockTime) + 31556926
|
const extLockTime = Number(lockTime) + 31556926
|
||||||
console.log('LockTime: ', lockTime)
|
|
||||||
|
|
||||||
const tx1 = await delegateContract.methods
|
await delegateContract.methods.setApprovalForAll(Alice, true).send({
|
||||||
.setApprovalForAll(Alice, true)
|
from: Alice
|
||||||
.send({
|
})
|
||||||
from: Alice
|
|
||||||
})
|
|
||||||
console.log('TX1: ', tx1)
|
|
||||||
|
|
||||||
const tx2 = await veOcean.increaseUnlockTime(Alice, extLockTime)
|
await veOcean.increaseUnlockTime(Alice, extLockTime)
|
||||||
console.log('TX2: ', tx2)
|
|
||||||
|
|
||||||
const estGas = await calculateEstimatedGas(
|
const estGas = await calculateEstimatedGas(
|
||||||
Alice,
|
Alice,
|
||||||
|
@ -163,7 +158,6 @@ describe('veOcean tests', async () => {
|
||||||
extLockTime,
|
extLockTime,
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
console.log('estGas', estGas)
|
|
||||||
|
|
||||||
const tx3 = await sendTx(
|
const tx3 = await sendTx(
|
||||||
Alice,
|
Alice,
|
||||||
|
@ -181,5 +175,31 @@ describe('veOcean tests', async () => {
|
||||||
console.log('TX3: ', tx3)
|
console.log('TX3: ', tx3)
|
||||||
assert(tx3, 'Transaction failed')
|
assert(tx3, 'Transaction failed')
|
||||||
assert(tx3.events.DelegateBoost, 'No Delegate boost event')
|
assert(tx3.events.DelegateBoost, 'No Delegate boost event')
|
||||||
|
|
||||||
|
const delegateQuery = {
|
||||||
|
query: `query {
|
||||||
|
VeDelegation(id:"${Alice.toLowerCase()}"){
|
||||||
|
id
|
||||||
|
delegator {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
receiver {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
tokenId
|
||||||
|
amount
|
||||||
|
cancelTime
|
||||||
|
expireTime
|
||||||
|
block
|
||||||
|
}
|
||||||
|
}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const delegateResponse = await fetch(subgraphUrl, {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify(delegateQuery)
|
||||||
|
})
|
||||||
|
const data = (await delegateResponse.json()).data.VeDelegation
|
||||||
|
console.log('Data', data)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue