Unable to create (Generated Contracts) Swift files
bhavinchauhanios opened this issue · 11 comments
Hey,
could you provide the abi json files used with bivrost?
Yes
Here! I attached cmd log which i done. Unable create (Generated Contracts)
Please post the contents of the .json
files here so we can examine the error. The log does not show anything out of the ordinary.
@chauhan9909 just to make sure. Truffle might have changed the output format of the json. Is the key still contract_name
or has it changed to contractName
. If so please try renaming them to contract_name
.
Here I attached Solidity file as well json file.
contract.zip
These files work completely for me when I use bivrost version 0.0.4.
Please check if you can see the generated contracts in Finder
, it might be that they are just not added to Xcode, which would lead to the empty group in Xcode. If the contracts are generated correctly and visible in Finder, just drag them into the Generated Contracts
group in Xcode.
One reason for this: If you added the bivrost folder to Xcode when there were no contracts generated yet, Xcode does not pick up the changes when you add them to the folder later (e.g. through generating them).
Let me check!
Same thing happened unable to create contract.
Once again i tried. Please check anything missing in this project.
https://drive.google.com/open?id=15wAyj3RFW33u89RgMQPyPs2vgKv9cbKQ
Okay, I think I see the problem.
Two things:
- If you are still doing what you did in the log you posted earlier, you are specifying the wrong folder. You are in the checkout folder of
bivrost-swift
, but are specifying'./contracts/*.json'
as input. That folder does not exist in your project. From your project structure you need to specify'../build/contracts/*.json'
. - The earlier json files were fine, but the new project contains a new version of the json format, which bivrost cannot parse yet (
contractName
instead ofcontract_name
). This then gives an error (if you actually get bivrost to parse the files with the correct path).
I was under the impression that bivrost throws an error in case there were no contracts to parse (no input). This is not the case and we should change that. Then you would see an error message like "No input contracts given. Please correct the path."
👏 Thank You so much now it's working perfect! 👏