Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
0be2e279
Commit
0be2e279
authored
Aug 17, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove fileManager dep
parent
a18bc70b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
72 additions
and
50 deletions
+72
-50
compile-tab.js
apps/remix-ide/src/app/tabs/compile-tab.js
+33
-3
publish-to-storage.tsx
...emix-ui/publish-to-storage/src/lib/publish-to-storage.tsx
+3
-3
publishOnSwarm.tsx
libs/remix-ui/publish-to-storage/src/lib/publishOnSwarm.tsx
+9
-11
publishToIPFS.tsx
libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx
+9
-11
index.ts
libs/remix-ui/publish-to-storage/src/lib/types/index.ts
+0
-1
renderer.tsx
libs/remix-ui/renderer/src/lib/renderer.tsx
+3
-4
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+1
-1
contract-selection.tsx
...remix-ui/solidity-compiler/src/lib/contract-selection.tsx
+2
-2
compileTabLogic.ts
...mix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
+7
-7
solidity-compiler.tsx
.../remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
+5
-5
index.ts
libs/remix-ui/solidity-compiler/src/lib/types/index.ts
+0
-2
No files found.
apps/remix-ide/src/app/tabs/compile-tab.js
View file @
0be2e279
...
@@ -52,9 +52,7 @@ class CompileTab extends ViewPlugin {
...
@@ -52,9 +52,7 @@ class CompileTab extends ViewPlugin {
eventHandlers
:
{},
eventHandlers
:
{},
loading
:
false
loading
:
false
}
}
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
,
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
,
this
.
contentImport
)
this
.
fileManager
,
this
.
contentImport
)
this
.
compiler
=
this
.
compileTabLogic
.
compiler
this
.
compiler
=
this
.
compileTabLogic
.
compiler
this
.
compileTabLogic
.
init
()
this
.
compileTabLogic
.
init
()
this
.
contractMap
=
{}
this
.
contractMap
=
{}
...
@@ -292,6 +290,38 @@ class CompileTab extends ViewPlugin {
...
@@ -292,6 +290,38 @@ class CompileTab extends ViewPlugin {
this
.
config
.
set
(
name
,
value
)
this
.
config
.
set
(
name
,
value
)
}
}
readFile
(
fileName
)
{
return
this
.
call
(
'fileManager'
,
'readFile'
,
fileName
)
}
fileProviderOf
(
fileName
)
{
return
this
.
fileManager
.
fileProviderOf
(
fileName
)
}
getFileManagerMode
()
{
return
this
.
fileManager
.
mode
}
fileExists
(
fileName
)
{
return
this
.
call
(
'fileManager'
,
'exists'
,
fileName
)
}
writeFile
(
fileName
,
content
)
{
return
this
.
call
(
'fileManager'
,
'writeFile'
,
fileName
,
content
)
}
readFile
(
fileName
)
{
return
this
.
call
(
'fileManager'
,
'readFile'
,
fileName
)
}
saveCurrentFile
()
{
return
this
.
fileManager
.
saveCurrentFile
()
}
open
(
fileName
)
{
return
this
.
call
(
'fileManager'
,
'open'
,
fileName
)
}
onActivation
()
{
onActivation
()
{
this
.
call
(
'manager'
,
'activatePlugin'
,
'solidity-logic'
)
this
.
call
(
'manager'
,
'activatePlugin'
,
'solidity-logic'
)
this
.
listenToEvents
()
this
.
listenToEvents
()
...
...
libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx
View file @
0be2e279
...
@@ -5,7 +5,7 @@ import { publishToIPFS } from './publishToIPFS'
...
@@ -5,7 +5,7 @@ import { publishToIPFS } from './publishToIPFS'
import
{
publishToSwarm
}
from
'./publishOnSwarm'
import
{
publishToSwarm
}
from
'./publishOnSwarm'
export
const
PublishToStorage
=
(
props
:
RemixUiPublishToStorageProps
)
=>
{
export
const
PublishToStorage
=
(
props
:
RemixUiPublishToStorageProps
)
=>
{
const
{
api
,
storage
,
fileManager
,
contract
,
resetStorage
}
=
props
const
{
api
,
storage
,
contract
,
resetStorage
}
=
props
const
[
state
,
setState
]
=
useState
({
const
[
state
,
setState
]
=
useState
({
modal
:
{
modal
:
{
title
:
''
,
title
:
''
,
...
@@ -25,7 +25,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
...
@@ -25,7 +25,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
}
else
{
}
else
{
if
(
storage
===
'swarm'
)
{
if
(
storage
===
'swarm'
)
{
try
{
try
{
const
result
=
await
publishToSwarm
(
contract
,
fileManager
)
const
result
=
await
publishToSwarm
(
contract
,
api
)
modal
(
`Published
${
contract
.
name
}
's Metadata`
,
publishMessage
(
result
.
uploaded
))
modal
(
`Published
${
contract
.
name
}
's Metadata`
,
publishMessage
(
result
.
uploaded
))
// triggered each time there's a new verified publish (means hash correspond)
// triggered each time there's a new verified publish (means hash correspond)
...
@@ -39,7 +39,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
...
@@ -39,7 +39,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
}
}
}
else
{
}
else
{
try
{
try
{
const
result
=
await
publishToIPFS
(
contract
,
fileManager
)
const
result
=
await
publishToIPFS
(
contract
,
api
)
modal
(
`Published
${
contract
.
name
}
's Metadata`
,
publishMessage
(
result
.
uploaded
))
modal
(
`Published
${
contract
.
name
}
's Metadata`
,
publishMessage
(
result
.
uploaded
))
// triggered each time there's a new verified publish (means hash correspond)
// triggered each time there's a new verified publish (means hash correspond)
...
...
libs/remix-ui/publish-to-storage/src/lib/publishOnSwarm.tsx
View file @
0be2e279
...
@@ -2,7 +2,7 @@ import swarm from 'swarmgw'
...
@@ -2,7 +2,7 @@ import swarm from 'swarmgw'
const
swarmgw
=
swarm
()
const
swarmgw
=
swarm
()
export
const
publishToSwarm
=
async
(
contract
,
fileManager
)
=>
{
export
const
publishToSwarm
=
async
(
contract
,
api
)
=>
{
// gather list of files to publish
// gather list of files to publish
const
sources
=
[]
const
sources
=
[]
let
metadata
let
metadata
...
@@ -38,16 +38,14 @@ export const publishToSwarm = async (contract, fileManager) => {
...
@@ -38,16 +38,14 @@ export const publishToSwarm = async (contract, fileManager) => {
throw
new
Error
(
'Error while extracting the hash from metadata.json'
)
throw
new
Error
(
'Error while extracting the hash from metadata.json'
)
}
}
fileManager
.
fileProviderOf
(
fileName
).
get
(
fileName
,
(
error
,
content
)
=>
{
api
.
readFile
(
fileName
).
then
((
content
)
=>
{
if
(
error
)
{
sources
.
push
({
console
.
log
(
error
)
content
:
content
,
}
else
{
hash
:
hash
,
sources
.
push
({
filename
:
fileName
content
:
content
,
})
hash
:
hash
,
}).
catch
((
error
)
=>
{
filename
:
fileName
console
.
log
(
error
)
})
}
})
})
}))
}))
// publish the list of sources in order, fail if any failed
// publish the list of sources in order, fail if any failed
...
...
libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx
View file @
0be2e279
...
@@ -6,7 +6,7 @@ const ipfsNodes = [
...
@@ -6,7 +6,7 @@ const ipfsNodes = [
new
IpfsClient
({
host
:
'127.0.0.1'
,
port
:
5001
,
protocol
:
'http'
})
new
IpfsClient
({
host
:
'127.0.0.1'
,
port
:
5001
,
protocol
:
'http'
})
]
]
export
const
publishToIPFS
=
async
(
contract
,
fileManager
)
=>
{
export
const
publishToIPFS
=
async
(
contract
,
api
)
=>
{
// gather list of files to publish
// gather list of files to publish
const
sources
=
[]
const
sources
=
[]
let
metadata
let
metadata
...
@@ -42,16 +42,14 @@ export const publishToIPFS = async (contract, fileManager) => {
...
@@ -42,16 +42,14 @@ export const publishToIPFS = async (contract, fileManager) => {
throw
new
Error
(
'Error while extracting the hash from metadata.json'
)
throw
new
Error
(
'Error while extracting the hash from metadata.json'
)
}
}
fileManager
.
fileProviderOf
(
fileName
).
get
(
fileName
,
(
error
,
content
)
=>
{
api
.
readFile
(
fileName
).
then
((
content
)
=>
{
if
(
error
)
{
sources
.
push
({
console
.
log
(
error
)
content
:
content
,
}
else
{
hash
:
hash
,
sources
.
push
({
filename
:
fileName
content
:
content
,
})
hash
:
hash
,
}).
catch
((
error
)
=>
{
filename
:
fileName
console
.
log
(
error
)
})
}
})
})
}))
}))
// publish the list of sources in order, fail if any failed
// publish the list of sources in order, fail if any failed
...
...
libs/remix-ui/publish-to-storage/src/lib/types/index.ts
View file @
0be2e279
export
interface
RemixUiPublishToStorageProps
{
export
interface
RemixUiPublishToStorageProps
{
api
:
any
,
api
:
any
,
storage
:
string
,
storage
:
string
,
fileManager
:
any
,
contract
:
any
,
contract
:
any
,
resetStorage
:
()
=>
void
resetStorage
:
()
=>
void
}
}
libs/remix-ui/renderer/src/lib/renderer.tsx
View file @
0be2e279
...
@@ -4,10 +4,9 @@ interface RendererProps {
...
@@ -4,10 +4,9 @@ interface RendererProps {
message
:
any
;
message
:
any
;
opt
?:
any
,
opt
?:
any
,
plugin
:
any
,
plugin
:
any
,
fileManager
:
any
}
}
export
const
Renderer
=
({
message
,
opt
=
{},
fileManager
,
plugin
}:
RendererProps
)
=>
{
export
const
Renderer
=
({
message
,
opt
=
{},
plugin
}:
RendererProps
)
=>
{
const
[
messageText
,
setMessageText
]
=
useState
(
null
)
const
[
messageText
,
setMessageText
]
=
useState
(
null
)
const
[
editorOptions
,
setEditorOptions
]
=
useState
({
const
[
editorOptions
,
setEditorOptions
]
=
useState
({
useSpan
:
false
,
useSpan
:
false
,
...
@@ -95,10 +94,10 @@ export const Renderer = ({ message, opt = {}, fileManager, plugin }: RendererPro
...
@@ -95,10 +94,10 @@ export const Renderer = ({ message, opt = {}, fileManager, plugin }: RendererPro
const
_errorClick
=
(
errFile
,
errLine
,
errCol
)
=>
{
const
_errorClick
=
(
errFile
,
errLine
,
errCol
)
=>
{
if
(
errFile
!==
plugin
.
getConfiguration
(
'currentFile'
))
{
if
(
errFile
!==
plugin
.
getConfiguration
(
'currentFile'
))
{
// TODO: refactor with this._components.contextView.jumpTo
// TODO: refactor with this._components.contextView.jumpTo
const
provider
=
fileManager
.
fileProviderOf
(
errFile
)
const
provider
=
plugin
.
fileProviderOf
(
errFile
)
if
(
provider
)
{
if
(
provider
)
{
provider
.
exists
(
errFile
).
then
(()
=>
{
provider
.
exists
(
errFile
).
then
(()
=>
{
fileManager
.
open
(
errFile
)
plugin
.
open
(
errFile
)
plugin
.
call
(
'editor'
,
'gotoLine'
,
errLine
,
errCol
)
plugin
.
call
(
'editor'
,
'gotoLine'
,
errLine
,
errCol
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
...
...
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
0be2e279
...
@@ -197,7 +197,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -197,7 +197,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
// Load solc compiler version according to pragma in contract file
// Load solc compiler version according to pragma in contract file
const
_setCompilerVersionFromPragma
=
(
filename
:
string
)
=>
{
const
_setCompilerVersionFromPragma
=
(
filename
:
string
)
=>
{
if
(
!
state
.
allversions
)
return
if
(
!
state
.
allversions
)
return
compileTabLogic
.
fileManager
.
readFile
(
filename
).
then
(
data
=>
{
api
.
readFile
(
filename
).
then
(
data
=>
{
const
pragmaArr
=
data
.
match
(
/
(
pragma solidity
(
.+
?)
;
)
/g
)
const
pragmaArr
=
data
.
match
(
/
(
pragma solidity
(
.+
?)
;
)
/g
)
if
(
pragmaArr
&&
pragmaArr
.
length
===
1
)
{
if
(
pragmaArr
&&
pragmaArr
.
length
===
1
)
{
const
pragmaStr
=
pragmaArr
[
0
].
replace
(
'pragma solidity'
,
''
).
trim
()
const
pragmaStr
=
pragmaArr
[
0
].
replace
(
'pragma solidity'
,
''
).
trim
()
...
...
libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx
View file @
0be2e279
...
@@ -7,7 +7,7 @@ import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line
...
@@ -7,7 +7,7 @@ import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line
import
'./css/style.css'
import
'./css/style.css'
export
const
ContractSelection
=
(
props
:
ContractSelectionProps
)
=>
{
export
const
ContractSelection
=
(
props
:
ContractSelectionProps
)
=>
{
const
{
api
,
contractMap
,
fileManager
,
contractsDetails
,
modal
}
=
props
const
{
api
,
contractMap
,
contractsDetails
,
modal
}
=
props
const
[
contractList
,
setContractList
]
=
useState
([])
const
[
contractList
,
setContractList
]
=
useState
([])
const
[
selectedContract
,
setSelectedContract
]
=
useState
(
''
)
const
[
selectedContract
,
setSelectedContract
]
=
useState
(
''
)
const
[
storage
,
setStorage
]
=
useState
(
null
)
const
[
storage
,
setStorage
]
=
useState
(
null
)
...
@@ -234,7 +234,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
...
@@ -234,7 +234,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
<
span
className=
"mt-2 mx-3 w-100 alert alert-warning"
role=
"alert"
>
No Contract Compiled Yet
</
span
>
<
span
className=
"mt-2 mx-3 w-100 alert alert-warning"
role=
"alert"
>
No Contract Compiled Yet
</
span
>
</
article
></
section
>
</
article
></
section
>
}
}
<
PublishToStorage
api=
{
api
}
storage=
{
storage
}
fileManager=
{
fileManager
}
contract=
{
contractsDetails
[
selectedContract
]
}
resetStorage=
{
resetStorage
}
/>
<
PublishToStorage
api=
{
api
}
storage=
{
storage
}
contract=
{
contractsDetails
[
selectedContract
]
}
resetStorage=
{
resetStorage
}
/>
</>
</>
)
)
}
}
...
...
libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
View file @
0be2e279
...
@@ -18,7 +18,7 @@ export class CompileTab extends Plugin {
...
@@ -18,7 +18,7 @@ export class CompileTab extends Plugin {
public
compilerImport
public
compilerImport
public
event
public
event
constructor
(
public
api
,
public
fileManager
,
public
contentImport
)
{
constructor
(
public
api
,
public
contentImport
)
{
super
(
profile
)
super
(
profile
)
this
.
event
=
new
EventEmitter
()
this
.
event
=
new
EventEmitter
()
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
call
(
'contentImport'
,
'resolveAndSave'
,
url
).
then
((
result
)
=>
cb
(
null
,
result
)).
catch
((
error
)
=>
cb
(
error
.
message
)))
this
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
this
.
call
(
'contentImport'
,
'resolveAndSave'
,
url
).
then
((
result
)
=>
cb
(
null
,
result
)).
catch
((
error
)
=>
cb
(
error
.
message
)))
...
@@ -79,7 +79,7 @@ export class CompileTab extends Plugin {
...
@@ -79,7 +79,7 @@ export class CompileTab extends Plugin {
*/
*/
compileFile
(
target
)
{
compileFile
(
target
)
{
if
(
!
target
)
throw
new
Error
(
'No target provided for compiliation'
)
if
(
!
target
)
throw
new
Error
(
'No target provided for compiliation'
)
const
provider
=
this
.
fileManager
.
fileProviderOf
(
target
)
const
provider
=
this
.
api
.
fileProviderOf
(
target
)
if
(
!
provider
)
throw
new
Error
(
`cannot compile
${
target
}
. Does not belong to any explorer`
)
if
(
!
provider
)
throw
new
Error
(
`cannot compile
${
target
}
. Does not belong to any explorer`
)
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
provider
.
get
(
target
,
(
error
,
content
)
=>
{
provider
.
get
(
target
,
(
error
,
content
)
=>
{
...
@@ -93,14 +93,14 @@ export class CompileTab extends Plugin {
...
@@ -93,14 +93,14 @@ export class CompileTab extends Plugin {
}
}
async
isHardhatProject
()
{
async
isHardhatProject
()
{
if
(
this
.
fileManager
.
mode
===
'localhost'
)
{
if
(
this
.
api
.
getFileManagerMode
()
===
'localhost'
)
{
return
await
this
.
fileManager
.
e
xists
(
'hardhat.config.js'
)
return
await
this
.
api
.
fileE
xists
(
'hardhat.config.js'
)
}
else
return
false
}
else
return
false
}
}
runCompiler
(
hhCompilation
)
{
runCompiler
(
hhCompilation
)
{
try
{
try
{
if
(
this
.
fileManager
.
mode
===
'localhost'
&&
hhCompilation
)
{
if
(
this
.
api
.
getFileManagerMode
()
===
'localhost'
&&
hhCompilation
)
{
const
{
currentVersion
,
optimize
,
runs
}
=
this
.
compiler
.
state
const
{
currentVersion
,
optimize
,
runs
}
=
this
.
compiler
.
state
if
(
currentVersion
)
{
if
(
currentVersion
)
{
const
fileContent
=
`module.exports = {
const
fileContent
=
`module.exports = {
...
@@ -114,7 +114,7 @@ export class CompileTab extends Plugin {
...
@@ -114,7 +114,7 @@ export class CompileTab extends Plugin {
}
}
`
`
const
configFilePath
=
'remix-compiler.config.js'
const
configFilePath
=
'remix-compiler.config.js'
this
.
fileManager
.
setFileContent
(
configFilePath
,
fileContent
)
this
.
api
.
writeFile
(
configFilePath
,
fileContent
)
this
.
call
(
'hardhat'
,
'compile'
,
configFilePath
).
then
((
result
)
=>
{
this
.
call
(
'hardhat'
,
'compile'
,
configFilePath
).
then
((
result
)
=>
{
this
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
result
})
this
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
result
})
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
...
@@ -122,7 +122,7 @@ export class CompileTab extends Plugin {
...
@@ -122,7 +122,7 @@ export class CompileTab extends Plugin {
})
})
}
}
}
}
this
.
fileManager
.
saveCurrentFile
()
this
.
api
.
saveCurrentFile
()
this
.
event
.
emit
(
'removeAnnotations'
)
this
.
event
.
emit
(
'removeAnnotations'
)
var
currentFile
=
this
.
api
.
getConfiguration
(
'currentFile'
)
var
currentFile
=
this
.
api
.
getConfiguration
(
'currentFile'
)
return
this
.
compileFile
(
currentFile
)
return
this
.
compileFile
(
currentFile
)
...
...
libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
View file @
0be2e279
...
@@ -9,7 +9,7 @@ import { Renderer } from '@remix-ui/renderer' // eslint-disable-line
...
@@ -9,7 +9,7 @@ import { Renderer } from '@remix-ui/renderer' // eslint-disable-line
import
'./css/style.css'
import
'./css/style.css'
export
const
SolidityCompiler
=
(
props
:
SolidityCompilerProps
)
=>
{
export
const
SolidityCompiler
=
(
props
:
SolidityCompilerProps
)
=>
{
const
{
plugin
,
plugin
:
{
compileTabLogic
,
fileManager
,
contractsDetails
,
contractMap
,
compileErrors
,
isHardHatProject
,
setHardHatCompilation
,
configurationSettings
}
}
=
props
const
{
plugin
,
plugin
:
{
compileTabLogic
,
contractsDetails
,
contractMap
,
compileErrors
,
isHardHatProject
,
setHardHatCompilation
,
configurationSettings
}
}
=
props
const
[
state
,
setState
]
=
useState
({
const
[
state
,
setState
]
=
useState
({
contractsDetails
:
{},
contractsDetails
:
{},
eventHandlers
:
{},
eventHandlers
:
{},
...
@@ -80,18 +80,18 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
...
@@ -80,18 +80,18 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
<>
<>
<
div
id=
"compileTabView"
>
<
div
id=
"compileTabView"
>
<
CompilerContainer
api=
{
plugin
}
compileTabLogic=
{
compileTabLogic
}
tooltip=
{
toast
}
modal=
{
modal
}
compiledFileName=
{
currentFile
}
setHardHatCompilation=
{
setHardHatCompilation
.
bind
(
plugin
)
}
updateCurrentVersion=
{
updateCurrentVersion
}
isHardHatProject=
{
isHardHatProject
}
configurationSettings=
{
configurationSettings
}
/>
<
CompilerContainer
api=
{
plugin
}
compileTabLogic=
{
compileTabLogic
}
tooltip=
{
toast
}
modal=
{
modal
}
compiledFileName=
{
currentFile
}
setHardHatCompilation=
{
setHardHatCompilation
.
bind
(
plugin
)
}
updateCurrentVersion=
{
updateCurrentVersion
}
isHardHatProject=
{
isHardHatProject
}
configurationSettings=
{
configurationSettings
}
/>
<
ContractSelection
api=
{
plugin
}
contractMap=
{
contractMap
}
fileManager=
{
fileManager
}
contractsDetails=
{
contractsDetails
}
modal=
{
modal
}
/>
<
ContractSelection
api=
{
plugin
}
contractMap=
{
contractMap
}
contractsDetails=
{
contractsDetails
}
modal=
{
modal
}
/>
<
div
className=
"remixui_errorBlobs p-4"
data
-
id=
"compiledErrors"
>
<
div
className=
"remixui_errorBlobs p-4"
data
-
id=
"compiledErrors"
>
<
span
data
-
id=
{
`compilationFinishedWith_${currentVersion}`
}
></
span
>
<
span
data
-
id=
{
`compilationFinishedWith_${currentVersion}`
}
></
span
>
{
compileErrors
.
error
&&
<
Renderer
message=
{
compileErrors
.
error
.
formattedMessage
||
compileErrors
.
error
}
plugin=
{
plugin
}
opt=
{
{
type
:
compileErrors
.
error
.
severity
||
'error'
,
errorType
:
compileErrors
.
error
.
type
}
}
fileManager=
{
fileManager
}
/>
}
{
compileErrors
.
error
&&
<
Renderer
message=
{
compileErrors
.
error
.
formattedMessage
||
compileErrors
.
error
}
plugin=
{
plugin
}
opt=
{
{
type
:
compileErrors
.
error
.
severity
||
'error'
,
errorType
:
compileErrors
.
error
.
type
}
}
/>
}
{
compileErrors
.
error
&&
(
compileErrors
.
error
.
mode
===
'panic'
)
&&
modal
(
'Error'
,
panicMessage
(
compileErrors
.
error
.
formattedMessage
),
'Close'
,
null
)
}
{
compileErrors
.
error
&&
(
compileErrors
.
error
.
mode
===
'panic'
)
&&
modal
(
'Error'
,
panicMessage
(
compileErrors
.
error
.
formattedMessage
),
'Close'
,
null
)
}
{
compileErrors
.
errors
&&
compileErrors
.
errors
.
length
&&
compileErrors
.
errors
.
map
((
err
,
index
)
=>
{
{
compileErrors
.
errors
&&
compileErrors
.
errors
.
length
&&
compileErrors
.
errors
.
map
((
err
,
index
)
=>
{
if
(
plugin
.
getConfiguration
(
'hideWarnings'
))
{
if
(
plugin
.
getConfiguration
(
'hideWarnings'
))
{
if
(
err
.
severity
!==
'warning'
)
{
if
(
err
.
severity
!==
'warning'
)
{
return
<
Renderer
key=
{
index
}
message=
{
err
.
formattedMessage
}
plugin=
{
plugin
}
opt=
{
{
type
:
err
.
severity
,
errorType
:
err
.
type
}
}
fileManager=
{
fileManager
}
/>
return
<
Renderer
key=
{
index
}
message=
{
err
.
formattedMessage
}
plugin=
{
plugin
}
opt=
{
{
type
:
err
.
severity
,
errorType
:
err
.
type
}
}
/>
}
}
}
else
{
}
else
{
return
<
Renderer
key=
{
index
}
message=
{
err
.
formattedMessage
}
plugin=
{
plugin
}
opt=
{
{
type
:
err
.
severity
,
errorType
:
err
.
type
}
}
fileManager=
{
fileManager
}
/>
return
<
Renderer
key=
{
index
}
message=
{
err
.
formattedMessage
}
plugin=
{
plugin
}
opt=
{
{
type
:
err
.
severity
,
errorType
:
err
.
type
}
}
/>
}
}
})
}
})
}
</
div
>
</
div
>
...
...
libs/remix-ui/solidity-compiler/src/lib/types/index.ts
View file @
0be2e279
...
@@ -7,7 +7,6 @@ export interface SolidityCompilerProps {
...
@@ -7,7 +7,6 @@ export interface SolidityCompilerProps {
isHardHatProject
:
boolean
,
isHardHatProject
:
boolean
,
compileTabLogic
:
any
,
compileTabLogic
:
any
,
contractsDetails
:
Record
<
string
,
any
>
,
contractsDetails
:
Record
<
string
,
any
>
,
fileManager
:
any
,
contentImport
:
any
,
contentImport
:
any
,
call
:
(...
args
)
=>
void
call
:
(...
args
)
=>
void
on
:
(...
args
)
=>
void
,
on
:
(...
args
)
=>
void
,
...
@@ -35,7 +34,6 @@ export interface ContractSelectionProps {
...
@@ -35,7 +34,6 @@ export interface ContractSelectionProps {
contractMap
:
{
contractMap
:
{
file
:
string
file
:
string
}
|
Record
<
string
,
any
>
,
}
|
Record
<
string
,
any
>
,
fileManager
:
any
,
modal
:
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
modal
:
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
contractsDetails
:
Record
<
string
,
any
>
contractsDetails
:
Record
<
string
,
any
>
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment