Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
import {
|
2022-09-07 12:30:53 +02:00
|
|
|
DatatokenCreateParams,
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
Nft,
|
|
|
|
NftFactory,
|
|
|
|
NftCreateData,
|
|
|
|
sleep
|
|
|
|
} from '@oceanprotocol/lib'
|
|
|
|
import { assert } from 'chai'
|
|
|
|
import Web3 from 'web3'
|
|
|
|
import { homedir } from 'os'
|
|
|
|
import fs from 'fs'
|
|
|
|
import { fetch } from 'cross-fetch'
|
|
|
|
|
|
|
|
const data = JSON.parse(
|
|
|
|
fs.readFileSync(
|
|
|
|
process.env.ADDRESS_FILE ||
|
|
|
|
`${homedir}/.ocean/ocean-contracts/artifacts/address.json`,
|
|
|
|
'utf8'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
const addresses = data.development
|
|
|
|
const web3 = new Web3('http://127.0.0.1:8545')
|
|
|
|
|
|
|
|
const subgraphUrl =
|
|
|
|
'http://127.0.0.1:9000/subgraphs/name/oceanprotocol/ocean-subgraph'
|
|
|
|
|
|
|
|
describe('Tests coverage without provider/aquarius', async () => {
|
|
|
|
let nft: Nft
|
|
|
|
let Factory: NftFactory
|
|
|
|
let accounts: string[]
|
|
|
|
let publisherAccount: string
|
|
|
|
let newOwnerAccount: string
|
2022-11-24 14:40:31 +01:00
|
|
|
let time: number
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
|
|
|
|
before(async () => {
|
|
|
|
nft = new Nft(web3)
|
|
|
|
Factory = new NftFactory(addresses.ERC721Factory, web3)
|
|
|
|
accounts = await web3.eth.getAccounts()
|
|
|
|
publisherAccount = accounts[0]
|
|
|
|
newOwnerAccount = accounts[1].toLowerCase()
|
2022-11-24 14:40:31 +01:00
|
|
|
const date = new Date()
|
|
|
|
time = Math.floor(date.getTime() / 1000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('should publish a dataset (create NFT + ERC20)', async () => {
|
|
|
|
const nftParams: NftCreateData = {
|
|
|
|
name: 'testNFT',
|
|
|
|
symbol: 'TST',
|
|
|
|
templateIndex: 1,
|
|
|
|
tokenURI: '',
|
|
|
|
transferable: true,
|
|
|
|
owner: publisherAccount
|
|
|
|
}
|
2022-09-07 12:30:53 +02:00
|
|
|
const erc20Params: DatatokenCreateParams = {
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
templateIndex: 1,
|
|
|
|
cap: '100000',
|
|
|
|
feeAmount: '0',
|
|
|
|
paymentCollector: '0x0000000000000000000000000000000000000000',
|
|
|
|
feeToken: '0x0000000000000000000000000000000000000000',
|
|
|
|
minter: publisherAccount,
|
|
|
|
mpFeeAddress: '0x0000000000000000000000000000000000000000'
|
|
|
|
}
|
2022-09-07 12:30:53 +02:00
|
|
|
const result = await Factory.createNftWithDatatoken(
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
publisherAccount,
|
|
|
|
nftParams,
|
|
|
|
erc20Params
|
|
|
|
)
|
|
|
|
const erc721Address = result.events.NFTCreated.returnValues[0]
|
|
|
|
|
|
|
|
// graph tests here
|
2023-05-13 14:00:52 +02:00
|
|
|
await sleep(3000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
const graphNftToken = erc721Address.toLowerCase()
|
|
|
|
const query = {
|
|
|
|
query: `query {
|
2023-05-13 14:00:52 +02:00
|
|
|
nft(id:"${graphNftToken}"){symbol,id,eventIndex}}`
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
}
|
|
|
|
const response = await fetch(subgraphUrl, {
|
|
|
|
method: 'POST',
|
|
|
|
body: JSON.stringify(query)
|
|
|
|
})
|
2023-05-13 14:00:52 +02:00
|
|
|
await sleep(3000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
const queryResult = await response.json()
|
|
|
|
assert(queryResult.data.nft.id === graphNftToken)
|
2023-05-13 14:00:52 +02:00
|
|
|
assert(
|
|
|
|
queryResult.data.nft.eventIndex !== null &&
|
|
|
|
queryResult.data.nft.eventIndex > 0
|
|
|
|
)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
it('should publish and transfer an NFT', async () => {
|
|
|
|
const nftParams: NftCreateData = {
|
|
|
|
name: 'testNFT',
|
|
|
|
symbol: 'TST',
|
|
|
|
templateIndex: 1,
|
|
|
|
tokenURI: '',
|
|
|
|
transferable: true,
|
|
|
|
owner: publisherAccount
|
|
|
|
}
|
2022-09-07 12:30:53 +02:00
|
|
|
const erc20Params: DatatokenCreateParams = {
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
templateIndex: 1,
|
|
|
|
cap: '100000',
|
|
|
|
feeAmount: '0',
|
|
|
|
paymentCollector: '0x0000000000000000000000000000000000000000',
|
|
|
|
feeToken: '0x0000000000000000000000000000000000000000',
|
|
|
|
minter: publisherAccount,
|
|
|
|
mpFeeAddress: '0x0000000000000000000000000000000000000000'
|
|
|
|
}
|
2022-09-07 12:30:53 +02:00
|
|
|
const result = await Factory.createNftWithDatatoken(
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
publisherAccount,
|
|
|
|
nftParams,
|
|
|
|
erc20Params
|
|
|
|
)
|
2023-05-13 14:00:52 +02:00
|
|
|
await sleep(3000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
const erc721Address = result.events.NFTCreated.returnValues[0]
|
2022-11-24 14:40:31 +01:00
|
|
|
const nftAddress = erc721Address.toLowerCase()
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
|
|
|
|
// Transfer the NFT
|
2022-11-24 14:40:31 +01:00
|
|
|
const tx = await nft.transferNft(
|
|
|
|
nftAddress,
|
|
|
|
publisherAccount,
|
|
|
|
newOwnerAccount
|
|
|
|
)
|
|
|
|
|
2023-05-13 14:00:52 +02:00
|
|
|
await sleep(3000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
const query2 = {
|
|
|
|
query: `query {
|
2022-11-24 14:40:31 +01:00
|
|
|
nft(id:"${nftAddress}"){
|
|
|
|
symbol,
|
|
|
|
id,
|
|
|
|
owner{id},
|
|
|
|
transferable,
|
2023-05-13 14:00:52 +02:00
|
|
|
transferHistory(orderBy: timestamp, orderDirection: desc){id,nft,oldOwner,newOwner,txId,eventIndex,timestamp,block}
|
2022-11-24 14:40:31 +01:00
|
|
|
}}`
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
}
|
|
|
|
const response = await fetch(subgraphUrl, {
|
|
|
|
method: 'POST',
|
|
|
|
body: JSON.stringify(query2)
|
|
|
|
})
|
2023-05-13 14:00:52 +02:00
|
|
|
await sleep(3000)
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
const queryResult = await response.json()
|
2022-11-24 14:40:31 +01:00
|
|
|
const transferHistory = queryResult.data.nft.transferHistory[0]
|
|
|
|
|
|
|
|
assert(queryResult.data.nft.owner.id === newOwnerAccount)
|
|
|
|
assert(
|
|
|
|
transferHistory.id ===
|
2023-05-13 14:00:52 +02:00
|
|
|
`${nftAddress}-${
|
|
|
|
tx.transactionHash
|
|
|
|
}-${tx.events.Transfer.logIndex.toFixed(1)}`,
|
2022-11-24 14:40:31 +01:00
|
|
|
'Invalid transferHistory Id'
|
|
|
|
)
|
|
|
|
assert(transferHistory.txId === tx.transactionHash, 'invalid txId')
|
2023-05-13 14:00:52 +02:00
|
|
|
assert(
|
|
|
|
transferHistory.eventIndex === tx.events.Transfer.logIndex,
|
|
|
|
'invalid eventIndex'
|
|
|
|
)
|
2022-11-24 14:40:31 +01:00
|
|
|
assert(transferHistory.timestamp)
|
|
|
|
|
|
|
|
assert(transferHistory.timestamp >= time - 500, 'incorrect value timestamp')
|
|
|
|
assert(transferHistory.timestamp < time + 500, 'incorrect value timestamp')
|
|
|
|
assert(transferHistory.block === tx.blockNumber, 'blockNumber')
|
Implementing first pass of veAllocate schema, handlers, and test cove… (#490)
* Implementing first pass of veAllocate schema, handlers, and test coverage.
* Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come.
* Created documentation. Moving tests away from subgraph and into df-py.
* Expanding documentation to be thorough and cover more of the work involved.
* use barge artifacts
* use proper contracts in ci
* use barge artifacts folder
* fix replace
* use npm contracts dep
* use latest contracts for barge
* fix some lint
* Fix linter errors
* Update schema
* Finished basic integration of setAllocation event and verified queries/schema is working as intended.
* Fixing amount getter.
* Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors.
* Fixing import.
* Use .zero()
* Improve readability
* Add allocated to schema
* Update abi
* Update event handlers in the template
* Update veREADME
* Remove `AllocationRemoved` handler
* Hooking data for tx, firstContact, lastUpdate, block
* Update event abi
* Add chainId and nftAddress to schema
* Update `handleAllocationSet`
* Update abi
* Update readme
* Set initial values
* Fix math
* Missing event param
* set initial value of `lastContact`
* veOcean template
* VeOcean entity
* Handler functions - wip
* rename file
* Delegation schema
* veDelegate mapping file
* Rename
* Update template
* Update schema
* Update replaces
* Add handler for delegation
* Update schema
* getveDelegation
* Update naming
* Add deposit entity
* Update template
* Make delegation an array
* Add `handleDelegation`
* Add `handleDeposit` for veOCEAN
* Add `getveOCEAN` util function
* Add `getDeposit` util function
* Add `handleBurnBoost`
* Add `handleExtendBoost`
* Add `handleTransferBoost`
* Set default veOCEAN
* Remove unused import
* Rename Deposit to VeDeposit
* Include block number
* Remove `allocatedTotal`
* Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not..
* bump contracts to v1.1.1
* bump contracts
* bump to contracts 1.1.2
* fix script for networks without ve
* add veAllocation.sol's AllocationSetMultiple
* copy artfacts from barge for npm quickstart:barge
* fix using barge artifacts
* temp debug
* use barge artifacts
* use contracts 1.1.3
* use same approach for 'development'
* bump ocean-contracts
Co-authored-by: alexcos20 <alex.coseru@gmail.com>
Co-authored-by: mihaisc <mihai@oceanprotocol.com>
Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
|
|
|
})
|
|
|
|
})
|