public void VisitCode(Keccak codeHash, byte[] code, VisitContext visitContext) { _builder.AppendLine($"{GetPrefix(visitContext)}CODE {codeHash} LENGTH {code.Length}"); }
public void VisitExtension(TrieNode node, VisitContext visitContext) { _builder.AppendLine($"{GetPrefix(visitContext)}EXTENSION {(node.Keccak?.Bytes ?? node.FullRlp?.Bytes)?.ToHexString()}"); }
public void VisitBranch(TrieNode node, VisitContext visitContext) { _builder.AppendLine($"{GetPrefix(visitContext)}BRANCH {(node.Keccak?.Bytes ?? node.FullRlp?.Bytes)?.ToHexString()}"); }
public void VisitMissingNode(Keccak nodeHash, VisitContext visitContext) { _builder.AppendLine($"{GetIndent(visitContext.Level) }{GetChildIndex(visitContext)}MISSING {nodeHash}"); }
private string GetChildIndex(VisitContext context) => context.BranchChildIndex == null ? string.Empty : $"{context.BranchChildIndex:00} ";
private string GetPrefix(VisitContext context) => string.Concat($"{GetIndent(context.Level)}", context.IsStorage ? "STORAGE " : "", $"{GetChildIndex(context)}");