Skip to content

Commit

Permalink
Merge branch 'rm-goerli'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Oct 18, 2024
2 parents 55c77a7 + 788ccac commit 6494a12
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately.

### [Unreleased]
- Update manufacturer HID descriptor to bitbox.swiss
- Ethereum: remove deprecated Goerli network

### 9.21.0
- Bitcoin: add support for sending to silent payment (BIP-352) addresses
Expand Down
11 changes: 2 additions & 9 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ const PARAMS: &[Params] = &[
name: "Ethereum",
unit: "ETH",
},
Params {
coin: None,
bip44_coin: 1 + HARDENED,
chain_id: 5,
name: "Goerli",
unit: "GOETH",
},
Params {
coin: None,
bip44_coin: 1 + HARDENED,
Expand Down Expand Up @@ -154,8 +147,8 @@ mod tests {
assert_eq!(get(Some(EthCoin::Eth), 0).unwrap().name, "Ethereum");
assert_eq!(get(Some(EthCoin::Eth), 1).unwrap().name, "Ethereum");
assert_eq!(get(None, 1).unwrap().name, "Ethereum");
assert_eq!(get(Some(EthCoin::Eth), 5).unwrap().name, "Goerli");
assert_eq!(get(None, 5).unwrap().name, "Goerli");
assert_eq!(get(Some(EthCoin::Eth), 11155111).unwrap().name, "Sepolia");
assert_eq!(get(None, 11155111).unwrap().name, "Sepolia");
assert_eq!(
get(Some(EthCoin::Eth), 56).unwrap().name,
"Binance Smart Chain"
Expand Down
6 changes: 3 additions & 3 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/pubrequest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ mod tests {
CONFIRM_COUNTER
} {
1 => {
assert_eq!(params.title, "Goerli");
assert_eq!(params.title, "Sepolia");
assert_eq!(params.body, "Warning: unusual keypath m/44'/60'/0'/0/0. Proceed only if you know what you are doing.");
}
2 => {
assert_eq!(params.title, "Goerli");
assert_eq!(params.title, "Sepolia");
assert_eq!(params.body, ADDRESS);
}
_ => panic!("too many user confirmations"),
Expand All @@ -228,7 +228,7 @@ mod tests {
coin: pb::EthCoin::Eth as _,
display: true,
contract_address: b"".to_vec(),
chain_id: 5,
chain_id: 11155111,
})),
Ok(Response::Pub(pb::PubResponse {
r#pub: ADDRESS.into()
Expand Down
1 change: 0 additions & 1 deletion src/rust/bitbox02-rust/src/hww/api/ethereum/sighash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ mod tests {
var nets = []*params.ChainConfig{
params.MainnetChainConfig,
params.SepoliaChainConfig,
params.GoerliChainConfig,
&params.ChainConfig{
ChainID: big.NewInt(200),
LondonBlock: big.NewInt(12965000),
Expand Down
12 changes: 6 additions & 6 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ mod tests {
assert_eq!(unsafe { UI_COUNTER }, 1);
}

/// Standard ETH transaction on an unusual keypath (Goerli on mainnet keypath)
/// Standard ETH transaction on an unusual keypath (Sepolia on mainnet keypath)
#[test]
pub fn test_process_warn_unusual_keypath() {
const KEYPATH: &[u32] = &[44 + HARDENED, 60 + HARDENED, 0 + HARDENED, 0, 0];
Expand All @@ -643,21 +643,21 @@ mod tests {
CONFIRM_COUNTER
} {
1 => {
assert_eq!(params.title, "Goerli");
assert_eq!(params.title, "Sepolia");
assert_eq!(params.body, "Warning: unusual keypath m/44'/60'/0'/0/0. Proceed only if you know what you are doing.");
true
}
_ => panic!("too many user confirmations"),
}
})),
ui_transaction_address_create: Some(Box::new(|amount, address| {
assert_eq!(amount, "0.530564 GOETH");
assert_eq!(amount, "0.530564 SEPETH");
assert_eq!(address, "0x04F264Cf34440313B4A0192A352814FBe927b885");
true
})),
ui_transaction_fee_create: Some(Box::new(|total, fee, longtouch| {
assert_eq!(total, "0.53069 GOETH");
assert_eq!(fee, "0.000126 GOETH");
assert_eq!(total, "0.53069 SEPETH");
assert_eq!(fee, "0.000126 SEPETH");
assert!(longtouch);
true
})),
Expand All @@ -677,7 +677,7 @@ mod tests {
value: b"\x07\x5c\xf1\x25\x9e\x9c\x40\x00".to_vec(),
data: b"".to_vec(),
host_nonce_commitment: None,
chain_id: 5,
chain_id: 11155111,
address_case: pb::EthAddressCase::Mixed as _,
})))
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/rust/bitbox02-rust/src/hww/api/ethereum/signmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ mod tests {
CONFIRM_COUNTER
} {
1 => {
assert_eq!(params.title, "Goerli");
assert_eq!(params.title, "Sepolia");
assert_eq!(params.body, "Warning: unusual keypath m/44'/60'/0'/0/0. Proceed only if you know what you are doing.");
true
}
2 => {
assert_eq!(params.title, "Goerli");
assert_eq!(params.title, "Sepolia");
assert_eq!(params.body, EXPECTED_ADDRESS);
true
}
Expand All @@ -183,7 +183,7 @@ mod tests {
keypath: KEYPATH.to_vec(),
msg: MESSAGE.to_vec(),
host_nonce_commitment: None,
chain_id: 5,
chain_id: 11155111,
}))
.unwrap();
assert_eq!(unsafe { CONFIRM_COUNTER }, 3);
Expand Down

0 comments on commit 6494a12

Please sign in to comment.