docs: More docs and improvements of existing docs

- Tried not to leave a single public function undocumented, though did not double-document public function with obvious names
- Remove all mentions of the strategy selector in favour of the strategy registry (to avoid confusion)
This commit is contained in:
TAMARA LIPOWSKI
2025-02-05 16:35:43 -05:00
parent 44e8e0bb96
commit 07457b5f76
10 changed files with 43 additions and 14 deletions

View File

@@ -16,11 +16,13 @@ pub fn bytes_to_address(address: &Bytes) -> Result<Address, EncodingError> {
}
}
/// Converts a general `BigUint` to an EVM-specific `U256` value.
pub fn biguint_to_u256(value: &BigUint) -> U256 {
let bytes = value.to_bytes_be();
U256::from_be_slice(&bytes)
}
/// Encodes the input data for a function call to the given function selector.
pub fn encode_input(selector: &str, mut encoded_args: Vec<u8>) -> Vec<u8> {
let mut hasher = Keccak256::new();
hasher.update(selector.as_bytes());