Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ak88 committed Sep 26, 2024
1 parent c219536 commit 8d4ec6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Nethermind/Nethermind.Evm/CodeInfoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ public void InsertCode(IWorldState state, ReadOnlyMemory<byte> code, Address cod
_codeCache.Set(codeHash, codeInfo);
}

/// <summary>
/// Insert a delegation to <paramref name="codeSource"/> into <paramref name="authority"/>
/// </summary>
public void SetDelegation(IWorldState state, Address codeSource, Address authority, IReleaseSpec spec)
{
byte[] authorizedBuffer = new byte[Eip7702Constants.DelegationHeader.Length + Address.Size];
Expand Down Expand Up @@ -164,7 +167,6 @@ public ValueHash256 GetExecutableCodeHash(IWorldState worldState, Address addres

/// <remarks>
/// Parses delegation code to extract the contained address.
/// <b>Assumes </b><paramref name="code"/> <b>is delegation code!</b>
/// </remarks>
private static bool TryGetDelegatedAddress(ReadOnlySpan<byte> code, [NotNullWhen(true)] out Address? address)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Nethermind/Nethermind.Evm/ICodeInfoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public interface ICodeInfoRepository
CodeInfo GetCachedCodeInfo(IWorldState worldState, Address codeSource, IReleaseSpec vmSpec, out Address? delegationAddress);
ValueHash256 GetExecutableCodeHash(IWorldState worldState, Address address);
void InsertCode(IWorldState state, ReadOnlyMemory<byte> code, Address codeOwner, IReleaseSpec spec);

/// <summary>
/// Insert a delegation code into an <see cref="Account"/>.
/// </summary>
void SetDelegation(IWorldState state, Address codeSource, Address authority, IReleaseSpec spec);
bool TryGetDelegation(IReadOnlyStateProvider worldState, Address address, [NotNullWhen(true)] out Address? delegatedAddress);
}
Expand Down

0 comments on commit 8d4ec6f

Please sign in to comment.