rust/api/ethereum/pubrequest: test confirm title
@@ -237,6 +237,7 @@ mod tests {
})),
keystore_secp256k1_pubkey_uncompressed: Some(Box::new(|_| Ok(PUBKEY))),
ui_confirm_create: Some(Box::new(|params| {
+ assert_eq!(params.title, "Ethereum");
assert_eq!(params.body, "0xF4C21710Ef8b5a5Ec4bd3780A687FE083446e67B");
true
})),
@@ -350,6 +351,7 @@ mod tests {
}))
);
+ const TOKEN_NAME: &str = "ERC20 token";
// All good, with display.
mock(Data {
eth_params_get: Some(Box::new(|_| {
@@ -362,13 +364,14 @@ mod tests {
eth_erc20_params_get: Some(Box::new(|_, _| {
Some(bitbox02::app_eth::ERC20Params {
unit: "ETH",
- name: "ERC20 token",
+ name: TOKEN_NAME,
contract_address: CONTRACT_ADDRESS,
decimals: 6,
})
})),
keystore_secp256k1_pubkey_uncompressed: Some(Box::new(|_| Ok(PUBKEY))),
ui_confirm_create: Some(Box::new(|params| {
+ assert_eq!(params.title, TOKEN_NAME);
assert_eq!(params.body, "0xF4C21710Ef8b5a5Ec4bd3780A687FE083446e67B");
true
})),
