Переглянути джерело

Remove outdated api-scripts

Leszek Wiesner 3 роки тому
батько
коміт
9ad65560c6

+ 0 - 29
utils/api-scripts/scripts/get-first-content-id.js

@@ -1,29 +0,0 @@
-/* global api, hashing, keyring, types, util, joy */
-
-// run this script with:
-// yarn workspace api-scripts script get-first-content-id
-//
-// or copy and paste the code into the pioneer javascript toolbox at:
-// https://testnet.joystream.org/#/js
-// requires nicaea release+
-
-const script = async ({ api }) => {
-  const entries = await api.query.dataDirectory.dataByContentId.entries()
-  const acceptedEntries = entries.filter(([, dataObject]) => dataObject.liaison_judgement.type === 'Accepted')
-  if (acceptedEntries.length) {
-    const [
-      {
-        args: [id],
-      },
-    ] = acceptedEntries[0]
-    console.log(`${api.createType('ContentId', id).encode()}`)
-  }
-}
-
-if (typeof module === 'undefined') {
-  // Pioneer js-toolbox
-  script({ api, hashing, keyring, types, util, joy })
-} else {
-  // Node
-  module.exports = script
-}

+ 0 - 37
utils/api-scripts/scripts/list-data-directory.js

@@ -1,37 +0,0 @@
-/* global api, hashing, keyring, types, util, joy */
-
-// run this script with:
-// yarn workspace api-scripts script list-data-directory
-//
-// or copy and paste the code into the pioneer javascript toolbox at:
-// https://testnet.joystream.org/#/js
-// requires nicaea release+
-
-const script = async ({ api }) => {
-  const entries = await api.query.dataDirectory.dataByContentId.entries()
-
-  console.error(`Data Directory contains ${entries.length} objects`)
-
-  const acceptedEntries = entries.filter(([, dataObject]) => dataObject.liaison_judgement.type === 'Accepted')
-
-  acceptedEntries.forEach(
-    ([
-      {
-        args: [id],
-      },
-      obj,
-    ]) => {
-      console.log(`contentId: ${api.createType('ContentId', id).encode()}, ipfs: ${obj.ipfs_content_id}`)
-    }
-  )
-
-  console.error(`Data Directory contains ${acceptedEntries.length} Accepted objects`)
-}
-
-if (typeof module === 'undefined') {
-  // Pioneer js-toolbox
-  script({ api, hashing, keyring, types, util, joy })
-} else {
-  // Node
-  module.exports = script
-}