mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-13 00:01:08 +00:00
Add a balance assertion test step
This commit is contained in:
@@ -26,6 +26,8 @@ use crate::{metadata::ContractInstance, traits::ResolutionContext};
|
||||
pub enum Step {
|
||||
/// A function call or an invocation to some function on some smart contract.
|
||||
FunctionCall(Input),
|
||||
/// A step for performing a balance assertion on some account or contract.
|
||||
BalanceAssertion(BalanceAssertion),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)]
|
||||
@@ -44,6 +46,20 @@ pub struct Input {
|
||||
pub variable_assignments: Option<VariableAssignments>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, Eq, PartialEq)]
|
||||
pub struct BalanceAssertion {
|
||||
/// The address that the balance assertion should be done on.
|
||||
///
|
||||
/// This is a string which will be resolved into an address when being processed. Therefore,
|
||||
/// this could be a normal hex address, a variable such as `Test.address`, or perhaps even a
|
||||
/// full on variable like `$VARIABLE:Uniswap`. It follows the same resolution rules that are
|
||||
/// followed in the calldata.
|
||||
pub address: String,
|
||||
|
||||
/// The amount of balance to assert that the account or contract has.
|
||||
pub amount: U256,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
|
||||
#[serde(untagged)]
|
||||
pub enum Expected {
|
||||
|
||||
Reference in New Issue
Block a user