Skip to content

Commit

Permalink
Merge pull request #7 from oceanprotocol/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
jamiehewitt15 authored Oct 16, 2024
2 parents 7333a12 + df447ea commit 371c671
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .env

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist/
out/
.vscode-test/
.vscode-test/
.env
24 changes: 9 additions & 15 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export function activate(context: vscode.ExtensionContext) {

if (asset) {
const details = `
Name: ${asset.metadata.name}
Type: ${asset.metadata.type}
Description: ${asset.metadata.description}
Author: ${asset.metadata.author}
Name: ${asset.metadata.name}\n
Type: ${asset.metadata.type}\n
Description: ${asset.metadata.description}\n
Author: ${asset.metadata.author}\n
`
vscode.window.showInformationMessage(details)
} else {
Expand All @@ -65,9 +65,6 @@ export function activate(context: vscode.ExtensionContext) {
let publishAsset = vscode.commands.registerCommand(
'ocean-protocol.publishAsset',
async (config: any, filePath: string, privateKey: string) => {
vscode.window.showInformationMessage(`Private key: ${privateKey}`)
vscode.window.showInformationMessage(`File path: ${filePath}`)
vscode.window.showInformationMessage(`Config: ${JSON.stringify(config)}`)
if (!filePath) {
vscode.window.showErrorMessage('No file path provided.')
return
Expand All @@ -77,14 +74,15 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showErrorMessage('No private key provided.')
return
}
vscode.window.showInformationMessage('Publishing asset')

try {
// Read the file
const fileContent = fs.readFileSync(filePath, 'utf8')
vscode.window.showInformationMessage('File content read successfully.')
console.log('File content read successfully.')

const asset: Asset = JSON.parse(fileContent)
vscode.window.showInformationMessage('Asset JSON parsed successfully.')
console.log('Asset JSON parsed successfully.')

// Set up the signer
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC)
Expand All @@ -98,12 +96,11 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Signer:', signer)
const chainId = await signer.getChainId()
console.log('Chain ID:', chainId)
vscode.window.showInformationMessage(`Signer: ${signer}`)

// Test provider connectivity
try {
const network = provider.network
vscode.window.showInformationMessage(`Connected to network: ${network}`)
console.log(`Connected to network: ${network}`)
} catch (networkError) {
console.error('Error connecting to network:', networkError)
vscode.window.showErrorMessage(
Expand All @@ -120,11 +117,8 @@ export function activate(context: vscode.ExtensionContext) {

const aquarius = new Aquarius(config.aquariusUrl)
console.log('Chain ID:', chainId)
vscode.window.showInformationMessage(`Chain ID: ${chainId}`)
const oceanConfig = new ConfigHelper().getConfig(chainId)
vscode.window.showInformationMessage(
`Ocean Config: ${JSON.stringify(oceanConfig)}`
)

console.log('Ocean Config:', oceanConfig)
console.log('creating asset:', asset)

Expand Down

0 comments on commit 371c671

Please sign in to comment.