MCPcopy Create free account
hub / github.com/base/base / predicate_data

Method predicate_data

crates/execution/txpool/src/validity_authorization.rs:104–126  ·  view source on GitHub ↗

Converts a predicate to its canonical EIP-712 representation.

(predicate: &ValidityPredicate)

Source from the content-addressed store, hash-verified

102
103 /// Converts a predicate to its canonical EIP-712 representation.
104 pub const fn predicate_data(predicate: &ValidityPredicate) -> Eip712ValidityPredicate {
105 let (account, slot, mask, op, value) = match predicate {
106 ValidityPredicate::Balance { address, op, value }
107 | ValidityPredicate::Nonce { address, op, value } => {
108 (*address, U256::ZERO, U256::ZERO, *op, *value)
109 }
110 ValidityPredicate::Storage { address, slot, mask, op, value } => {
111 (*address, *slot, *mask, *op, *value)
112 }
113 ValidityPredicate::BlockNumber { op, value }
114 | ValidityPredicate::FlashblockIndex { op, value } => {
115 (Address::ZERO, U256::ZERO, U256::ZERO, *op, *value)
116 }
117 };
118 Eip712ValidityPredicate {
119 kind: predicate.kind() as u8,
120 operator: op as u8,
121 account,
122 slot,
123 mask,
124 value,
125 }
126 }
127}
128
129#[cfg(test)]

Callers

nothing calls this directly

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected