FindoraNetwork / platform

Official Implementation of Findora Network.
https://findora.org
Other
73 stars 29 forks source link

fix fn exec #943

Closed shaorongqiang closed 1 year ago

shaorongqiang commented 1 year ago
malefooo commented 1 year ago

First, calling the contract-deposit --addr command will generate a ConvertAccount object. This object has a field called lowlevel_data, which has a default method called is_empty. This method uses CFG, and when CFG is called, it triggers a lazy_static!. Inside this static block there is a function called get_config, which in the case of not being tested receives command line arguments. However, these arguments do not include the --addr instruction, causing an error. Therefore, to avoid accessing CFG and triggering an error, these two parameters in CFG were changed to global variables.

Dependency chain: fn <- ConvertAccount <- CFG <- get_config

Current modification: fn <- ConvertAccount <- global param