Commit f6b101a6 authored by Mark Tyneway's avatar Mark Tyneway

state-surgery: fix string slice

For some reason `strings.TrimPrefix` is removing
an extra character sometimes. We want to remove the
`.json` extension and using it will sometimes also
remove the final character in the contract name.
This is problematic because when you call
`hh.GetDeployment`, with the name of the contract,
it will not be able to find the deployment because
the name of the deployment will not match the name
passed in by the user. This instead slices off the
`.json` from the string manually.
parent 127ae72f
......@@ -96,7 +96,7 @@ func (h *Hardhat) initDeployments() error {
return err
}
deployment.Name = filepath.Base(strings.TrimRight(name, ".json"))
deployment.Name = filepath.Base(name[:len(name)-5])
h.deployments = append(h.deployments, &deployment)
return nil
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment