assets.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is part of the storage node for the Joystream project.
  3. * Copyright (C) 2019 Joystream Contributors
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. 'use strict'
  19. const expect = require('chai').expect
  20. const { RuntimeApi } = require('@joystream/storage-runtime-api')
  21. describe('Assets', () => {
  22. let api
  23. before(async () => {
  24. api = await RuntimeApi.create()
  25. await api.identities.loadUnlock('test/data/edwards_unlocked.json')
  26. })
  27. it('returns DataObjects for a content ID', async () => {
  28. const obj = await api.assets.getDataObject('foo')
  29. expect(obj).to.be.null
  30. })
  31. it('can check the liaison for a DataObject', async () => {
  32. expect(async () => {
  33. await api.assets.checkLiaisonForDataObject('foo', 'bar')
  34. }).to.throw
  35. })
  36. // Needs properly staked accounts
  37. it('can accept content')
  38. it('can reject content')
  39. it('can create a storage relationship for content')
  40. it('can toggle a storage relationship to ready state')
  41. })