Does build --tx of AssetDefinition hang if the ContractOffer has not already had build --tx --send?

I am testing so I try to avoid actually doing a --send.
i was hoping build --tx without the --send just does a structure check of the tx.

Testing the ContractOffer with build --tx works OK.

But the following build --tx of the AssetDefinition hangs forever.

Is that because build --tx of the AssetDefinition expects to find the AssetOffer already on the blockchain?

Right now it is hanging forever on the build --tx of my AssetDefinition.
No Console messages (no errors displayed during the hang).

Here is the json input:
{“TransfersPermitted”: true, “TradeRestrictions”: [“AUS”], “EnforcementOrdersPermitted”: true, “VotingRights”: true, “VoteMultiplier”: 1, “AdministrationProposal”: true, “HolderProposal”: true, “AssetModificationGovernance”: 1, “TokenQty”: 256000, “AssetType”: “SHC”, “AssetPayload”: “0a0547524e4c541a15434f5649443139477265656e6c696768742e6f7267”}

NOTE: TradeRestrictions in Tokenized-smart-contract-agent-setup-final.pdf was 0.
But 0 gave me an type mismatch error from golang.
I investigated and it seems that it now should be a string array.
So that is what I put. And I saw an example using “AUS” to I put that in the array.

I went ahead last night and committed the ContractOffer to the blockchain.
Then I tried the AssetDefinition again but it still hangs without any error messages.

Also I do a sync before trying to store the Asset. The sync ran fine.

Any ideas?


Smart contract CLI doesn’t really keep track of the contract state, so it won’t know if the contract offer has been set yet or not. I would guess it is a configuration issue on your side. That json is valid except the quotes aren’t normal ASCII double quotes. I am guessing the forum editor might have done that though.

Maybe try putting print statements in the code to try to figure out where it is locking up.

I don’t see TradeRestrictions specified in the setup pdf, but it should be an array of three character strings for the polity that the asset is valid to be held.

Thank you for inspecting my json and determining that it is valid. Yes I have the normal quotes in the json file and is just this web page changing them.

I now suspect the build --tx is hanging because I see a newline ‘n’ crept into my json file
because this is a special .json hand-edited for a certain debugging case, and I guess the editor added the newline.

I will add code to my python app to search the .json file for ‘\n’ just before the build --tx and will have python return an error.

I am about to test and see if that is what the problem is.