Skip to content

Commit 044a267

Browse files
committed
adapter - ethereum:
- Ehereum Web Token - fix EthereumAdapter::has_privileges - more tests
1 parent 8577af1 commit 044a267

File tree

12 files changed

+557
-290
lines changed

12 files changed

+557
-290
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adapter/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ serde-hex = "0.1.0"
2424
# Ethereum
2525
web3 = { version = "0.17", features = ["http-tls", "signing"] }
2626
eth_checksum = "0.1"
27-
tiny-keccak = "1.5"
2827
ethstore = { git = "https://github.com/openethereum/openethereum", tag = "v3.1.1-rc.1" }
2928
create2 = "0.0.2"
3029

31-
# API client
32-
reqwest = { version = "0.11", features = ["json"] }
33-
3430
sha2 = "0.9"
3531
base64 = "0.13"
3632
once_cell = "^1.8"

adapter/src/dummy.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ use std::{collections::HashMap, fmt, sync::Arc};
1212

1313
#[derive(Debug, Clone)]
1414
pub struct DummyAdapter {
15+
/// Who am I
1516
identity: ValidatorId,
1617
config: Config,
17-
// Auth tokens that we have verified (tokenId => session)
18-
session_tokens: HashMap<String, ValidatorId>,
19-
// Auth tokens that we've generated to authenticate with someone (address => token)
18+
/// Auth tokens that we have verified (tokenId => session)
19+
session_tokens: HashMap<String, Address>,
20+
/// Auth tokens that we've generated to authenticate with someone (address => token)
2021
authorization_tokens: HashMap<String, String>,
2122
deposits: Deposits,
2223
}
@@ -145,7 +146,7 @@ impl Adapter for DummyAdapter {
145146
let who = self
146147
.session_tokens
147148
.iter()
148-
.find(|(_, id)| *id == &self.identity);
149+
.find(|(_, id)| *id == &self.identity.to_address());
149150
match who {
150151
Some((id, _)) => {
151152
let auth = self.authorization_tokens.get(id).expect("id should exist");

0 commit comments

Comments
 (0)