1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

modify transferOwnership integration test

This commit is contained in:
Matthias Kretschmann 2020-01-30 20:12:43 +01:00
parent 10558f9c96
commit 484cc6326b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 10 additions and 5 deletions

View File

@ -102,12 +102,18 @@ describe('Asset Owners', () => {
})
it('should be able to transfer ownership', async () => {
const { id } = await ocean.assets.create(metadata as any, account1)
const ddo = await ocean.assets.create(metadata as any, account1)
const newOwner = account2.getId()
// transfer
await ocean.assets.transferOwnership(id, account2.getId())
const newOwner = await ocean.keeper.didRegistry.getDIDOwner(id)
await ocean.assets.transferOwnership(ddo.id, newOwner)
assert.equal(newOwner, account2.getId())
// check owner change on-chain
const newOwnerChain = await ocean.keeper.didRegistry.getDIDOwner(ddo.id)
assert.equal(newOwnerChain, newOwner)
// check owner change off-chain
const newOwnerDdo = await ocean.assets.owner(ddo.id)
assert.equal(newOwnerDdo, newOwner)
})
})

View File

@ -47,7 +47,6 @@ const metadata: Partial<MetaData> = {
}
export const generateMetadata = (name: string, price?: number): Partial<MetaData> => ({
...metadata,
main: {
...metadata.main,
name,