Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaceImportAddresses does not work with multiple imports #117

Closed
jribbink opened this issue Aug 11, 2022 · 0 comments · Fixed by #119
Closed

replaceImportAddresses does not work with multiple imports #117

jribbink opened this issue Aug 11, 2022 · 0 comments · Fixed by #119
Assignees
Labels
bug Something isn't working

Comments

@jribbink
Copy link
Contributor

Instructions

Update the regex for imports to parse multiple imports from the same address in cadence code (only supports single imports currently)

Problem

Code such as the following will not work

const addressMap = {
  Messages: '0xf8d6e0586b0a20c7',
  OtherMessages: '0xf8d6e0586b0a20c7',
};

const code = `
  import Messages, OtherMessages from 0x1
  
  pub fun main(){}
`;

const replaced = replaceImportAddresses(code, addressMap);
console.log({ replaced });

Context

See original issue: #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant