- 
                Notifications
    You must be signed in to change notification settings 
- Fork 106
Expose policy governance APIs #1402
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
base: dev
Are you sure you want to change the base?
Conversation
|  | ||
| try | ||
| { | ||
| if (path != null && File.Exists(path)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method are duplicated, and it's better to use !string.IsNullOrEmpty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's possible to simplify the method.
    private static string? TryGetSourceSnippet(string fileName, int startZeroBasedLineNumber, int endZeroBasedLineNumber)
    {
        if (string.IsNullOrWhiteSpace(fileName)) return null;
        var path = Path.IsPathRooted(fileName) ? fileName : Path.Combine(Environment.CurrentDirectory, fileName);
        try
        {
            if (!File.Exists(path))
                return null;
             string[] lines = File.ReadAllLines(path);
             int start = Math.Max(0, startZeroBasedLineNumber);
             int end = Math.Min(lines.Length - 1, Math.Max(startZeroBasedLineNumber, endZeroBasedLineNumber));
             if (start > end) return null;
             return string.Join(Environment.NewLine, lines[start..(end + 1)]).Trim();
        }
        catch { }
        return null;
    }
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer needed, this pr now focus on only one task
| { | ||
| static class OptimizedScriptBuilder | ||
| { | ||
| private static readonly IReadOnlyDictionary<OpCode, (OpCode LongOp, int SizeDelta)> ShortToLongJumpMap = | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a part of 'Expose policy governance APIs' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed, this pr focus on only exposing poliocy govergance API now
| Rebased on the latest dev, resolved conflicts, and trimmed the branch so it now only exposes the policy/role governance APIs. Added native Policy setters/getters, RoleManagement.DesignateAsRole, TransactionAttribute wrappers, and refreshed the unit tests. NativeTest suite passes (dotnet test ... --filter NativeTest). | 
| Why? | 
Summary
Testing