pull/2491/head
bunsenstraat 3 years ago
parent 9f60ada45a
commit ba58484d21
  1. 4
      apps/remix-ide-e2e/src/tests/publishContract.test.ts
  2. 4
      libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx
  3. 2
      libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx

@ -66,7 +66,9 @@ module.exports = {
.waitForElementVisible('*[data-id="Deploy - transact (not payable)"]')
.click('*[data-id="Deploy - transact (not payable)"]')
.pause(5000)
.waitForElementVisible('[data-id="udappModalDialogModalBody-react"]')
.waitForElementVisible('[data-id="publishToStorageModalDialogModalBody-react"]', 60000)
.click('[data-id="publishToStorage-modal-footer-ok-react"]')
.pause(8000)
.getText('[data-id="udappModalDialogModalBody-react"]', (result) => {
const value = typeof result.value === 'string' ? result.value : null

@ -6,6 +6,7 @@ import { publishToSwarm } from './publishOnSwarm'
export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
const { api, storage, contract, resetStorage } = props
const [modalShown, setModalShown] = useState(false)
const [state, setState] = useState({
modal: {
title: '',
@ -38,7 +39,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
modal('Swarm Publish Failed', publishMessageFailed(storage, parseError))
}
} else {
if (!api.config.get('settings/ipfs-url')) {
if (!api.config.get('settings/ipfs-url') && !modalShown) {
modal('IPFS Settings', <div>You have not set your own custom IPFS settings.<br></br>
<br></br>
We wont be providing a public endpoint anymore for publishing your contracts to IPFS.<br></br>Instead of that, 4 options are now available:<br></br>
@ -82,6 +83,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
} catch (err) {
modal('IPFS Publish Failed', publishMessageFailed(storage, err))
}
setModalShown(true)
}
const publishMessage = (uploaded) => (

@ -121,7 +121,7 @@ const ipfsVerifiedPublish = async (content, expectedHash, api) => {
if (expectedHash && hash !== expectedHash) {
return { message: 'hash mismatch between solidity bytecode and uploaded content.', url: 'dweb:/ipfs/' + hash, hash }
} else {
api.writeFile('ipfs/' + results, content)
api.writeFile('ipfs/' + hash, content)
return { message: 'ok', url: 'dweb:/ipfs/' + hash, hash }
}
} catch (error) {

Loading…
Cancel
Save