Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed wallet_getCapabilities #104

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

varun-doshi
Copy link

Closes #99

Removed get_capabilities from the WalletCapabilities trait
In e2e_tests the capabilities is initialised manually with the contract address being pulled in from env variables.

@varun-doshi
Copy link
Author

There are 2 ways we can set the address in the capabilities var:

  • Hardcode it to some contract address
  • Pull from std::env

Comment on lines 60 to 74
let capabilities = {
let mut innermost_tree = BTreeMap::new();
innermost_tree.insert(
"addresses".to_string(),
vec![Address::from_str(&std::env::var("DELEGATION_ADDRESS").unwrap()).unwrap()],
);

let mut inner_tree = BTreeMap::new();
inner_tree.insert("delegation".to_string(), innermost_tree);

let mut capabilities = BTreeMap::new();
capabilities.insert(chain_id, inner_tree);

capabilities
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove the capabilities structs entirely, we don't need them anymore, and instead use a const address here or an env var

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, you mean to remove WalletCapabilities right?

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize)]
pub struct WalletCapabilities(pub HashMap<U64, Capabilities>);

I see its not really being used anywhere else in the code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@onbjerg
Copy link
Member

onbjerg commented Dec 3, 2024

@varun-doshi looks good overall, some lints are failing PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove wallet_getCapabilities
2 participants