Skip to content

Commit

Permalink
Fix contract address reset on file re-compile
Browse files Browse the repository at this point in the history
  • Loading branch information
ssteiger committed Jun 16, 2019
1 parent 71ffb24 commit 34bd8af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/components/contract-form/Functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ export default class Functions extends Component<Props> {
const { Text } = Typography

const { renderInputs, renderEthInput, createLabel, handleSubmit } = this
const { file: { abi, method_identifiers } } = this.props
const { functionCallResults } = this.props
const { file: { abi, method_identifiers }, functionCallResults } = this.props

return (
<React.Fragment>
Expand Down
6 changes: 4 additions & 2 deletions app/sagas/file/reCompileFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export default function* reCompileFile(action) {
// fetch new file content
const file = yield call(fetchFile, action.file)
// compile file
const compiledFile = yield call(compileVyperFile, file)
let compiledFile = yield call(compileVyperFile, file)
compiledFile = { ...compiledFile, deployedAt: { addresses: [], selected: {} } }
// save file in database
const query_find = { _id: file._id }
const { _id } = action.file
const query_find = { _id }
const query_change = { $set: { ...compiledFile } }
yield call(promiseDbUpdate, Files, query_find, query_change)
// update view
Expand Down

0 comments on commit 34bd8af

Please sign in to comment.