Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
pivilartisant committed Sep 26, 2024
1 parent 59a928a commit 82b2637
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Upload commands
`npm run build`
`SECRET_KEY=S...y node bin/index.js upload ./dist`

`npm run dev -- upload -w ./wallet_faker1.yaml -p faker1 ./dist`
6 changes: 3 additions & 3 deletions cli/src/commands/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { makeProviderFromNodeURLAndSecret } from './utils'
import { Listr, ListrTask } from 'listr2'
import { DeleteCtx } from '../tasks/tasks'

// Minimal implementation of delete command
export const deleteCommand = new Command('delete')
.alias('d')
.description('Delete the given website from Massa blockchain')
Expand All @@ -20,7 +21,6 @@ export const deleteCommand = new Command('delete')

const provider = await makeProviderFromNodeURLAndSecret(globalOptions)

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const sc = new SmartContract(provider, address)

const ctx: DeleteCtx = {
Expand All @@ -44,7 +44,7 @@ export const deleteCommand = new Command('delete')
export function deleteWebsiteTask(): ListrTask {
return {
title: 'Deleting website',
task: async (ctx, task) => {
task: async (ctx) => {
// No deleteWebsite in the SC yet
await deleteWebsite(ctx)
},
Expand All @@ -65,7 +65,7 @@ async function deleteWebsite(ctx: DeleteCtx) {
.then(() => {
console.log(`Successfully deleted the website at ${ctx.address}`)
})
.catch((error: any) => {
.catch((error) => {
console.error(error)
})
}
7 changes: 3 additions & 4 deletions smart-contract/assembly/contracts/deweb-interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
balance,
Context,
generateEvent,
sha256,
transferCoins,
} from '@massalabs/massa-as-sdk';
Expand Down Expand Up @@ -173,7 +172,7 @@ export function deleteFiles(_binaryArgs: StaticArray<u8>): void {
}
}

//TODO: verify that this function throws is mustValue is empty
// TODO: verify that this function throws is mustValue is empty
export function deleteWebsite(_: StaticArray<u8>): void {
_onlyOwner();
const filePaths = FILES_PATH_LIST.mustValue();
Expand All @@ -183,6 +182,6 @@ export function deleteWebsite(_: StaticArray<u8>): void {
FILES_PATH_LIST.set([]);
}

//TODO: delete all metadata
// TODO: delete all metadata

//TODO: delete SC
// TODO: delete SC
2 changes: 1 addition & 1 deletion smart-contract/src/e2e/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function assertFileIsDeleted(
throw new Error(`File still exists in list: ${filePath}`);
}

//IMPROVE: assert that the file is deleted from the chunks
// IMPROVE: assert that the file is deleted from the chunks
}

console.log(`File successfully deleted ${filePath} from list`);
Expand Down

0 comments on commit 82b2637

Please sign in to comment.