Skip to content

Conversation

@BrianBland
Copy link
Collaborator

@BrianBland BrianBland commented Jul 3, 2025

Proposed as a less-opinionated alternative to #145

This should support Transactions with any type that derefs to Database, including standard borrows as well as Arcs.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jul 3, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@BrianBland BrianBland force-pushed the brianbland/hide-lifetimes-via-deref branch from c4e3901 to 20053ad Compare July 3, 2025 22:38
@BrianBland BrianBland requested review from and-cb and jjtny1 July 3, 2025 22:38
@BrianBland BrianBland marked this pull request as ready for review July 3, 2025 22:39
jjtny1
jjtny1 previously approved these changes Jul 8, 2025
Comment on lines -318 to +344
let mut tx = db.begin_rw().unwrap();
let mut tx = begin_rw(&db).unwrap();
tx.set_account(AddressPath::for_address(address), Some(account1.clone())).unwrap();

tx.commit().unwrap();

let account2 = Account::new(456, U256::from(123), EMPTY_ROOT_HASH, KECCAK_EMPTY);
let mut tx = db.begin_rw().unwrap();
let mut tx = begin_rw(&db).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did this really have to change? Or is it just for testing this alternative pattern?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, accidentally updated this one

}
}

pub fn begin_ro<DB: Deref<Target = Database>>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: this could be an associated function, e.g. Database::begin_ro, although this will conflict with the existing begin_ro method. Just wanted to point this out; I'm not actually sure what's the most elegant syntax here (this can also be changed at a later time)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we could choose to specifically use Database::begin_ro and Database::begin_rw, removing the existing instance methods. Happy to do that in a follow up, as it will change many more instances in tests

@cb-heimdall
Copy link
Collaborator

Review Error for and-cb @ 2025-07-24 22:12:32 UTC
User failed mfa authentication, either user does not exist or public email is not set on your github profile. \ see go/mfa-help

@BrianBland BrianBland force-pushed the brianbland/hide-lifetimes-via-deref branch from 20053ad to b5bde05 Compare July 25, 2025 19:42
@cb-heimdall cb-heimdall dismissed jjtny1’s stale review July 25, 2025 19:42

Approved review 2998944923 from jjtny1 is now dismissed due to new commit. Re-request for approval.

@BrianBland BrianBland requested review from and-cb and jjtny1 July 25, 2025 20:00
@BrianBland BrianBland merged commit 7f31df8 into main Jul 25, 2025
18 checks passed
@BrianBland BrianBland deleted the brianbland/hide-lifetimes-via-deref branch July 25, 2025 20:03
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.

5 participants