Currently, we have to verify that each corrupt_* function has a feature = "malicious" config. One way to simplify this might be to have a macro, say corrupt! or malicious! that expands to something that just returns the input itself if the feature is not enabled, or calls the corrupt_* function if it is. This also allows us to feature gate the whole pub mod malicious block. Possible usages of this macro:
let y_i_commit = corrupt!(y_i_commit, self.corrupt_commit(index, y_i_commit));
corrupt!(y_i_commit, commit(index, y_i_commit)); // This expands to a let statement.
Currently, we have to verify that each
corrupt_*
function has afeature = "malicious"
config. One way to simplify this might be to have a macro, saycorrupt!
ormalicious!
that expands to something that just returns the input itself if the feature is not enabled, or calls thecorrupt_*
function if it is. This also allows us to feature gate the wholepub mod malicious
block. Possible usages of this macro:_Originally posted by @milapsheth in https://github.com/axelarnetwork/tofn/pull/86#discussion_r668919553_