conflict_resolution
stringlengths
27
16k
<<<<<<< using System.Drawing; ======= using System; using System.IO; using System.Threading.Tasks; using WaveEngine.Common.Math; >>>>>>> using System.IO; using System.Threading.Tasks; using WaveEngine.Common.Math; <<<<<<< ======= protected float canvasWidth; protected float canvasHeight; protected Vector4 clearColor; protected WebGLShader vertexShader; protected WebGLShader fragmentShader; protected WebGLProgram shaderProgram; >>>>>>> protected float canvasWidth; protected float canvasHeight; protected Vector4 clearColor; <<<<<<< ======= protected WebGLBuffer CreateArrayBuffer(Array items) { var arrayBuffer = gl.CreateBuffer(); gl.BindBuffer(WebGLRenderingContextBase.ARRAY_BUFFER, arrayBuffer); gl.BufferData(WebGLRenderingContextBase.ARRAY_BUFFER, items, WebGLRenderingContextBase.STATIC_DRAW); gl.BindBuffer(WebGLRenderingContextBase.ARRAY_BUFFER, null); return arrayBuffer; } protected WebGLBuffer CreateElementArrayBuffer(Array items) { var elementArrayBuffer = gl.CreateBuffer(); gl.BindBuffer(WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER, elementArrayBuffer); gl.BufferData(WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER, items, WebGLRenderingContextBase.STATIC_DRAW); gl.BindBuffer(WebGLRenderingContextBase.ELEMENT_ARRAY_BUFFER, null); return elementArrayBuffer; } protected void InitializeShaders(string vertexShaderCode, string fragmentShaderCode) { vertexShader = gl.CreateShader(WebGLRenderingContextBase.VERTEX_SHADER); gl.ShaderSource(vertexShader, vertexShaderCode); gl.CompileShader(vertexShader); var message = gl.GetShaderInfoLog(vertexShader); if (message.Length > 0) { throw new InvalidOperationException($"Shader Error: {message}"); } fragmentShader = gl.CreateShader(WebGLRenderingContextBase.FRAGMENT_SHADER); gl.ShaderSource(fragmentShader, fragmentShaderCode); gl.CompileShader(fragmentShader); message = gl.GetShaderInfoLog(fragmentShader); if (message.Length > 0) { throw new InvalidOperationException($"Shader Error: {message}"); } shaderProgram = gl.CreateProgram(); gl.AttachShader(shaderProgram, vertexShader); gl.AttachShader(shaderProgram, fragmentShader); gl.LinkProgram(shaderProgram); gl.UseProgram(shaderProgram); } protected async Task InitializeShadersFromAssetsAsync(string vertexShaderPath, string fragmentShaderPath) { var baseAddress = WasmResourceLoader.GetLocalAddress(); var vertexShaderStream = await WasmResourceLoader.LoadAsync(vertexShaderPath, baseAddress); string vertexShaderCode; using (var reader = new StreamReader(vertexShaderStream)) { vertexShaderCode = reader.ReadToEnd(); } var fragmentShaderStream = await WasmResourceLoader.LoadAsync(fragmentShaderPath, baseAddress); string fragmentShaderCode; using (var reader = new StreamReader(fragmentShaderStream)) { fragmentShaderCode = reader.ReadToEnd(); } InitializeShaders(vertexShaderCode, fragmentShaderCode); } >>>>>>>
<<<<<<< // The pass "SRPDefaultUnlit" is a fallback to legacy unlit rendering and is required to support unity 2d + unity UI that render in the scene. ======= static CustomSampler[] m_samplers = new CustomSampler[(int)CustomSamplerId.Max]; // The pass "SRPDefaultUnlit" is a fall back to legacy unlit rendering and is required to support unity 2d + unity UI that render in the scene. >>>>>>> static CustomSampler[] m_samplers = new CustomSampler[(int)CustomSamplerId.Max]; // The pass "SRPDefaultUnlit" is a fall back to legacy unlit rendering and is required to support unity 2d + unity UI that render in the scene. <<<<<<< bool enableBakeShadowMask = m_LightLoop.PrepareLightsForGPU(cmd, m_ShadowSettings, m_CullResults, camera); ======= bool enableBakeShadowMask; using (new ProfilingSample(cmd, "TP_PrepareLightsForGPU", GetSampler(CustomSamplerId.TPPrepareLightsForGPU))) { enableBakeShadowMask = m_LightLoop.PrepareLightsForGPU(m_ShadowSettings, m_CullResults, camera); } >>>>>>> bool enableBakeShadowMask; using (new ProfilingSample(cmd, "TP_PrepareLightsForGPU", GetSampler(CustomSamplerId.TPPrepareLightsForGPU))) { enableBakeShadowMask = m_LightLoop.PrepareLightsForGPU(cmd, m_ShadowSettings, m_CullResults, camera); }
<<<<<<< async Task ConnectAndLogIn() { await Client.ConnectAsync(); await Client.LoginAsync(Username, Password); } Client.Disconnected += async (e, args) => { Console.WriteLine($"Disconnected from Soulseek server: {args.Message}"); if (!(args.Exception is KickedFromServerException || args.Exception is ObjectDisposedException)) { Console.WriteLine($"Attepting to reconnect..."); await ConnectAndLogIn(); } }; ======= //Client.BrowseProgressUpdated += (e, args) => Console.WriteLine($"[BROWSE] {args.Username}: {args.BytesTransferred} of {args.Size} ({args.PercentComplete}%)"); >>>>>>> //Client.BrowseProgressUpdated += (e, args) => Console.WriteLine($"[BROWSE] {args.Username}: {args.BytesTransferred} of {args.Size} ({args.PercentComplete}%)"); async Task ConnectAndLogIn() { await Client.ConnectAsync(); await Client.LoginAsync(Username, Password); } Client.Disconnected += async (e, args) => { Console.WriteLine($"Disconnected from Soulseek server: {args.Message}"); if (!(args.Exception is KickedFromServerException || args.Exception is ObjectDisposedException)) { Console.WriteLine($"Attepting to reconnect..."); await ConnectAndLogIn(); } };
<<<<<<< using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "~M:HarmonyLib.HarmonySharedState.GetState~System.Collections.Generic.Dictionary{System.Reflection.MethodBase,System.Byte[]}")] [assembly: SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>", Scope = "member", Target = "~M:HarmonyLib.ReversePatcher.Patch(HarmonyLib.HarmonyReversePatchType)")] [assembly: SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.Patch")] [assembly: SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.InlineSignature.ModifierType")] [assembly: SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.")] [assembly: SuppressMessage("Performance", "CA1813:Avoid unsealed attributes")] [assembly: SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline")] [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b1")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b2")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b3")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b1")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b2")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b3")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b4")] ======= [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>", Scope = "member", Target = "~M:HarmonyLib.ReversePatcher.Patch(HarmonyLib.HarmonyReversePatchType)")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.Patch")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.InlineSignature.ModifierType")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1813:Avoid unsealed attributes")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b1")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b2")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b3")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b1")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b2")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b3")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b4")] >>>>>>> using System.Diagnostics.CodeAnalysis; [assembly: SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "<Pending>", Scope = "member", Target = "~M:HarmonyLib.ReversePatcher.Patch(HarmonyLib.HarmonyReversePatchType)")] [assembly: SuppressMessage("Design", "CA1036:Override methods on comparable types", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.Patch")] [assembly: SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "<Pending>", Scope = "type", Target = "~T:HarmonyLib.InlineSignature.ModifierType")] [assembly: SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.")] [assembly: SuppressMessage("Performance", "CA1813:Avoid unsealed attributes")] [assembly: SuppressMessage("Performance", "CA1810:Initialize reference type static fields inline")] [assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b1")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b2")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Net.b3")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b1")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b2")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b3")] [assembly: SuppressMessage("Code Quality", "IDE0051:Remove unused private members", Justification = "<Pending>", Scope = "member", Target = "~F:HarmonyLib.Sandbox.SomeStruct_Mono.b4")]
<<<<<<< [Ignore("Skip failed test")] [Test] public void Traverse_Missing_Method() { var instance = new TraverseMethods_Instance(); var trv = Traverse.Create(instance); string methodSig1 = ""; try { trv.Method("FooBar", new object[] { "hello", 123 }); } catch (MissingMethodException e) { methodSig1 = e.Message; } Assert.AreEqual("FooBar(System.String, System.Int32)", methodSig1); string methodSig2 = ""; try { var types = new Type[] { typeof(string), typeof(int) }; trv.Method("FooBar", types, new object[] { "hello", 123 }); } catch (MissingMethodException e) { methodSig2 = e.Message; } Assert.AreEqual("FooBar(System.String, System.Int32)", methodSig2); } [Test] ======= [TestMethod] >>>>>>> [Test]
<<<<<<< if (type == typeof(object)) return default; ======= #pragma warning restore RECS0017 if (type == typeof(object)) return default(T); >>>>>>> #pragma warning restore RECS0017 if (type == typeof(object)) return default;
<<<<<<< public override void CheckUrl(Uri url, Cookie[] cookies) { if (cookies.Length == 0) return; var cookie = cookies.FirstOrDefault(x => x.Name.IndexOf("oauth_code", StringComparison.CurrentCultureIgnoreCase) == 0); if (!string.IsNullOrWhiteSpace(cookie?.Value)) FoundAuthCode(cookie.Value); } ======= >>>>>>>
<<<<<<< string levelID = level.LevelID(); var apkTxn = new Apk.Transaction(); if (existingLevels.Contains(levelID)) { if (removeSongs) { // Currently does not handle transactions (it half-supports them) Console.WriteLine($"Removing: {level._songName}"); ulong levelPid = level.RemoveFromAssets(assets, apkTxn); // We also don't _need_ to remove this from the existingLevels, but we probably _should_ existingLevels.Remove(levelID); extrasCollection.levels.RemoveAll(ptr => ptr.pathID == levelPid); apkTxn.ApplyTo(apk); } else { Console.WriteLine($"Present: {level._songName}"); } ======= string levelID = level.GenerateBasicLevelID(); if(existingLevels.Contains(levelID)) { Console.WriteLine($"Present: {level._songName}"); >>>>>>> string levelID = level.GenerateBasicLevelID(); var apkTxn = new Apk.Transaction(); if (existingLevels.Contains(levelID)) { if (removeSongs) { // Currently does not handle transactions (it half-supports them) Console.WriteLine($"Removing: {level._songName}"); ulong levelPid = level.RemoveFromAssets(assets, apkTxn); // We also don't _need_ to remove this from the existingLevels, but we probably _should_ existingLevels.Remove(levelID); extrasCollection.levels.RemoveAll(ptr => ptr.pathID == levelPid); apkTxn.ApplyTo(apk); } else { Console.WriteLine($"Present: {level._songName}"); } <<<<<<< AssetPtr levelPtr = level.AddToAssets(assetsTxn, apkTxn); ======= var apkTxn = new Apk.Transaction(); AssetPtr levelPtr = level.AddToAssets(assetsTxn, apkTxn, levelID); >>>>>>> AssetPtr levelPtr = level.AddToAssets(assetsTxn, apkTxn, levelID);
<<<<<<< public LevelCollectionBehaviorData FindCustomLevelCollection() { var col = FindScript<LevelCollectionBehaviorData>(mb => mb.name == "CustomLevelCollection", l => true); if (col == null) { var ptr = AppendAsset(new MonoBehaviorAssetData() { data = new LevelCollectionBehaviorData(), name = "CustomLevelCollection", script = scriptIDToScriptPtr[LevelCollectionBehaviorData.ScriptID] }); col = ptr.FollowToScript<LevelCollectionBehaviorData>(this); } return col; } public LevelPackBehaviorData FindExtrasLevelPack() { AssetObject obj = objects[236]; // the index of the extras collection in sharedassets17 if (!(obj.data is MonoBehaviorAssetData)) throw new ParseException("Extras level pack not at normal spot (not monob)"); MonoBehaviorAssetData monob = (MonoBehaviorAssetData)obj.data; if (monob.name != "ExtrasLevelPack") throw new ParseException("Extras level pack not at normal spot"); return (LevelPackBehaviorData)monob.data; } public LevelPackBehaviorData FindCustomLevelPack() { var col = FindScript<LevelPackBehaviorData>(mb => mb.name == "CustomLevelPack", l => true); if (col == null) { // Make sure the CustomLevelCollection exists. _ = FindCustomLevelCollection(); var ptr = CreateCustomLevelPack(); col = ptr.FollowToScript<LevelPackBehaviorData>(this); } return col; } public AssetPtr CreateCustomLevelPack() { var ptr = AppendAsset(new MonoBehaviorAssetData() { data = new LevelPackBehaviorData() { packName = "Custom Songs", packID = "CustomPack", isPackAlwaysOwned = true, beatmapLevelCollection = new AssetPtr(0, GetAssetObjectFromScript<LevelCollectionBehaviorData>(mb => mb.name == "CustomLevelCollection", c => true).pathID), coverImage = new AssetPtr(0, 45) // Default }, name = "CustomLevelPack", script = new AssetPtr(1, LevelPackBehaviorData.PathID) }); return ptr; } public BeatmapLevelPackCollection FindMainLevelPackCollection() { // This file needs to be sharedassets19.assets for the MainLevelPackCollection return FindScript<BeatmapLevelPackCollection>(a => true); // Should only be one. } ======= private void TryToFindEnvironment(string name) { string monobName = name + "SceneInfo"; AssetObject obj = objects.Find(x => (x.data is MonoBehaviorAssetData) && ((x.data as MonoBehaviorAssetData).name == monobName)); if(obj == null) return; environmentIDToPtr.Add(name, new AssetPtr(0, obj.pathID)); } private void FindEnvironmentPointers() { TryToFindEnvironment("NiceEnvironment"); TryToFindEnvironment("TriangleEnvironment"); TryToFindEnvironment("BigMirrorEnvironment"); TryToFindEnvironment("KDAEnvironment"); TryToFindEnvironment("CrabRaveEnvironment"); environmentIDToPtr.Add("DefaultEnvironment", new AssetPtr(20, 1)); if(!environmentIDToPtr.ContainsKey("NiceEnvironment")) { // v1.0.0 environmentIDToPtr.Add("NiceEnvironment", new AssetPtr(38, 3)); } } >>>>>>> public LevelCollectionBehaviorData FindCustomLevelCollection() { var col = FindScript<LevelCollectionBehaviorData>(mb => mb.name == "CustomLevelCollection", l => true); if (col == null) { var ptr = AppendAsset(new MonoBehaviorAssetData() { data = new LevelCollectionBehaviorData(), name = "CustomLevelCollection", script = scriptIDToScriptPtr[LevelCollectionBehaviorData.ScriptID] }); col = ptr.FollowToScript<LevelCollectionBehaviorData>(this); } return col; } public LevelPackBehaviorData FindExtrasLevelPack() { AssetObject obj = objects[236]; // the index of the extras collection in sharedassets17 if (!(obj.data is MonoBehaviorAssetData)) throw new ParseException("Extras level pack not at normal spot (not monob)"); MonoBehaviorAssetData monob = (MonoBehaviorAssetData)obj.data; if (monob.name != "ExtrasLevelPack") throw new ParseException("Extras level pack not at normal spot"); return (LevelPackBehaviorData)monob.data; } public LevelPackBehaviorData FindCustomLevelPack() { var col = FindScript<LevelPackBehaviorData>(mb => mb.name == "CustomLevelPack", l => true); if (col == null) { // Make sure the CustomLevelCollection exists. _ = FindCustomLevelCollection(); var ptr = CreateCustomLevelPack(); col = ptr.FollowToScript<LevelPackBehaviorData>(this); } return col; } public AssetPtr CreateCustomLevelPack() { var ptr = AppendAsset(new MonoBehaviorAssetData() { data = new LevelPackBehaviorData() { packName = "Custom Songs", packID = "CustomPack", isPackAlwaysOwned = true, beatmapLevelCollection = new AssetPtr(0, GetAssetObjectFromScript<LevelCollectionBehaviorData>(mb => mb.name == "CustomLevelCollection", c => true).pathID), coverImage = new AssetPtr(0, 45) // Default }, name = "CustomLevelPack", script = new AssetPtr(1, LevelPackBehaviorData.PathID) }); return ptr; } public BeatmapLevelPackCollection FindMainLevelPackCollection() { // This file needs to be sharedassets19.assets for the MainLevelPackCollection return FindScript<BeatmapLevelPackCollection>(a => true); // Should only be one. } private void TryToFindEnvironment(string name) { string monobName = name + "SceneInfo"; AssetObject obj = objects.Find(x => (x.data is MonoBehaviorAssetData) && ((x.data as MonoBehaviorAssetData).name == monobName)); if(obj == null) return; environmentIDToPtr.Add(name, new AssetPtr(0, obj.pathID)); } private void FindEnvironmentPointers() { TryToFindEnvironment("NiceEnvironment"); TryToFindEnvironment("TriangleEnvironment"); TryToFindEnvironment("BigMirrorEnvironment"); TryToFindEnvironment("KDAEnvironment"); TryToFindEnvironment("CrabRaveEnvironment"); environmentIDToPtr.Add("DefaultEnvironment", new AssetPtr(20, 1)); if(!environmentIDToPtr.ContainsKey("NiceEnvironment")) { // v1.0.0 environmentIDToPtr.Add("NiceEnvironment", new AssetPtr(38, 3)); } }
<<<<<<< internal static AcmeDirectory AcmeDir = new AcmeDirectory ======= private static Uri[] StagingServers = new[] { new Uri("http://localhost:4000/directory"), WellKnownServers.LetsEncryptStaging }; internal static Directory AcmeDir = new Directory >>>>>>> private static Uri[] StagingServers = new[] { new Uri("http://localhost:4000/directory"), WellKnownServers.LetsEncryptStaging }; internal static AcmeDirectory AcmeDir = new AcmeDirectory
<<<<<<< ======= } >>>>>>> <<<<<<< constants["instanceCount"] = m_InstanceCountField.value; ======= constants["instanceCount"] = m_InstanceCountField.value; var progressIncrement = (progressEnd - progressStart) / m_InstanceCountField.value; >>>>>>> constants["instanceCount"] = m_InstanceCountField.value; var progressIncrement = (progressEnd - progressStart) / m_InstanceCountField.value;
<<<<<<< using LetsEncrypt.ACME.Simple.Services; using Microsoft.Web.Administration; using System.Linq; using static LetsEncrypt.ACME.Simple.Services.InputService; namespace LetsEncrypt.ACME.Simple.Plugins.TargetPlugins { class IISSite : IISPlugin, ITargetPlugin { string IHasName.Name { get { return nameof(IISSite); } } string ITargetPlugin.Description { get { return "All bindings for a single IIS site"; } } Target ITargetPlugin.Default(Options options) { if (!string.IsNullOrEmpty(options.SiteId)) { long siteId = 0; if (long.TryParse(options.SiteId, out siteId)) { var found = GetSites(options, false).FirstOrDefault(binding => binding.SiteId == siteId); if (found != null) { found.ExcludeBindings = options.ExcludeBindings; return found; } else { Program.Log.Error("Unable to find site with id {siteId}", siteId); } } else { Program.Log.Error("Invalid SiteId {siteId}", options.SiteId); } } else { Program.Log.Error("Please specify the --siteid argument"); } return null; } Target ITargetPlugin.Aquire(Options options) { var chosen = Program.Input.ChooseFromList("Choose site", GetSites(options, true), x => new Choice<Target>(x) { description = x.Host }, true); if (chosen != null) { // Exclude bindings Program.Input.WritePagedList(chosen.AlternativeNames.Select(x => Choice.Create(x, ""))); chosen.ExcludeBindings = Program.Input.RequestString("Press enter to include all listed hosts, or type a comma-separated lists of exclusions"); return chosen; } return null; } Target ITargetPlugin.Refresh(Options options, Target scheduled) { var match = GetSites(options, false).FirstOrDefault(binding => binding.Host == scheduled.Host); if (match != null) { UpdateWebRoot(scheduled, match); UpdateAlternativeNames(scheduled, match); return scheduled; } return null; } } ======= using LetsEncrypt.ACME.Simple.Clients; using LetsEncrypt.ACME.Simple.Services; using Microsoft.Web.Administration; using System.Linq; using static LetsEncrypt.ACME.Simple.Services.InputService; namespace LetsEncrypt.ACME.Simple.Plugins.TargetPlugins { class IISSite : IISClient, ITargetPlugin { string IHasName.Name => nameof(IISSite); string IHasName.Description => "All bindings for a single IIS site"; Target ITargetPlugin.Default(Options options) { if (!string.IsNullOrEmpty(options.SiteId)) { long siteId = 0; if (long.TryParse(options.SiteId, out siteId)) { var found = GetSites(options).FirstOrDefault(binding => binding.SiteId == siteId); if (found != null) { found.ExcludeBindings = options.ExcludeBindings; return found; } else { Program.Log.Error("Unable to find site with id {siteId}", siteId); } } else { Program.Log.Error("Invalid SiteId {siteId}", options.SiteId); } } else { Program.Log.Error("Please specify the --siteid argument"); } return null; } Target ITargetPlugin.Aquire(Options options, InputService input) { var chosen = input.ChooseFromList("Choose site", GetSites(options), x => new Choice<Target>(x) { description = x.Host }, true); if (chosen != null) { // Exclude bindings input.WritePagedList(chosen.AlternativeNames.Select(x => Choice.Create(x, ""))); chosen.ExcludeBindings = input.RequestString("Press enter to include all listed hosts, or type a comma-separated lists of exclusions"); return chosen; } return null; } Target ITargetPlugin.Refresh(Options options, Target scheduled) { var match = GetSites(options).FirstOrDefault(binding => binding.Host == scheduled.Host); if (match != null) { UpdateWebRoot(scheduled, match); UpdateAlternativeNames(scheduled, match); return scheduled; } return null; } } >>>>>>> using LetsEncrypt.ACME.Simple.Clients; using LetsEncrypt.ACME.Simple.Services; using Microsoft.Web.Administration; using System.Linq; using static LetsEncrypt.ACME.Simple.Services.InputService; namespace LetsEncrypt.ACME.Simple.Plugins.TargetPlugins { class IISSite : IISClient, ITargetPlugin { string IHasName.Name => nameof(IISSite); string IHasName.Description => "All bindings for a single IIS site"; Target ITargetPlugin.Default(Options options) { if (!string.IsNullOrEmpty(options.SiteId)) { long siteId = 0; if (long.TryParse(options.SiteId, out siteId)) { var found = GetSites(options, false).FirstOrDefault(binding => binding.SiteId == siteId); if (found != null) { found.ExcludeBindings = options.ExcludeBindings; return found; } else { Program.Log.Error("Unable to find site with id {siteId}", siteId); } } else { Program.Log.Error("Invalid SiteId {siteId}", options.SiteId); } } else { Program.Log.Error("Please specify the --siteid argument"); } return null; } Target ITargetPlugin.Aquire(Options options, InputService input) { var chosen = input.ChooseFromList("Choose site", GetSites(options, true), x => new Choice<Target>(x) { description = x.Host }, true); if (chosen != null) { // Exclude bindings input.WritePagedList(chosen.AlternativeNames.Select(x => Choice.Create(x, ""))); chosen.ExcludeBindings = input.RequestString("Press enter to include all listed hosts, or type a comma-separated lists of exclusions"); return chosen; } return null; } Target ITargetPlugin.Refresh(Options options, Target scheduled) { var match = GetSites(options).FirstOrDefault(binding => binding.Host == scheduled.Host); if (match != null) { UpdateWebRoot(scheduled, match); UpdateAlternativeNames(scheduled, match); return scheduled; } return null; } }
<<<<<<< private readonly DomainParseService _domainParser; private readonly Uri _resourceManagerEndpoint; ======= >>>>>>> private readonly Uri _resourceManagerEndpoint; <<<<<<< ISettingsService settings): base(dnsClient, log, settings) ======= ISettingsService settings) : base(dnsClient, log, settings) >>>>>>> ISettingsService settings) : base(dnsClient, log, settings) <<<<<<< _resourceManagerEndpoint = new Uri(AzureEnvironments.ResourceManagerUrls[AzureEnvironments.AzureCloud]); if (!string.IsNullOrEmpty(options.AzureEnvironment)) { if (!AzureEnvironments.ResourceManagerUrls.TryGetValue(options.AzureEnvironment, out var endpoint)) { // Custom endpoint endpoint = options.AzureEnvironment; } try { _resourceManagerEndpoint = new Uri(endpoint); } catch (Exception ex) { _log.Error(ex, "Could not parse Azure endpoint url. Falling back to default."); } } ======= _recordSets = new Dictionary<string, Dictionary<string, RecordSet>>(); >>>>>>> _recordSets = new Dictionary<string, Dictionary<string, RecordSet>>(); _resourceManagerEndpoint = new Uri(AzureEnvironments.ResourceManagerUrls[AzureEnvironments.AzureCloud]); if (!string.IsNullOrEmpty(options.AzureEnvironment)) { if (!AzureEnvironments.ResourceManagerUrls.TryGetValue(options.AzureEnvironment, out var endpoint)) { // Custom endpoint endpoint = options.AzureEnvironment; } try { _resourceManagerEndpoint = new Uri(endpoint); } catch (Exception ex) { _log.Error(ex, "Could not parse Azure endpoint url. Falling back to default."); } } <<<<<<< private ActiveDirectoryServiceSettings GetActiveDirectorySettingsForAzureEnvironment() { return _options.AzureEnvironment switch { AzureEnvironments.AzureChinaCloud => ActiveDirectoryServiceSettings.AzureChina, AzureEnvironments.AzureUSGovernment => ActiveDirectoryServiceSettings.AzureUSGovernment, AzureEnvironments.AzureGermanCloud => ActiveDirectoryServiceSettings.AzureGermany, _ => ActiveDirectoryServiceSettings.Azure, }; } private async Task<string> GetHostedZone(string recordName) ======= /// <summary> /// Translate full host name to zone relative name /// </summary> /// <param name="zone"></param> /// <param name="recordName"></param> /// <returns></returns> private string RelativeRecordName(string zone, string recordName) >>>>>>> private ActiveDirectoryServiceSettings GetActiveDirectorySettingsForAzureEnvironment() { return _options.AzureEnvironment switch { AzureEnvironments.AzureChinaCloud => ActiveDirectoryServiceSettings.AzureChina, AzureEnvironments.AzureUSGovernment => ActiveDirectoryServiceSettings.AzureUSGovernment, AzureEnvironments.AzureGermanCloud => ActiveDirectoryServiceSettings.AzureGermany, _ => ActiveDirectoryServiceSettings.Azure, }; } /// <summary> /// Translate full host name to zone relative name /// </summary> /// <param name="zone"></param> /// <param name="recordName"></param> /// <returns></returns> private string RelativeRecordName(string zone, string recordName) <<<<<<< "Can't find hosted zone for {domainName} in resource group {ResourceGroupName}", domainName, ======= "Can't find hosted zone for {recordName} in resource group {ResourceGroupName}", recordName, >>>>>>> "Can't find hosted zone for {recordName} in resource group {ResourceGroupName}", recordName,
<<<<<<< // Advanced services _client = Container.Resolve<LetsEncryptClient>(); _certificateService = new CertificateService(_options, _log, _client, _settings.ConfigPath); _renewalService = new RenewalService(_settings, _input, _clientName, _settings.ConfigPath); _taskScheduler = new TaskSchedulerService(_options, _input, _log, _clientName); ======= >>>>>>> // Advanced services _renewalService = new RenewalService(_settings, _input, _clientName, _settings.ConfigPath); _taskScheduler = new TaskSchedulerService(_options, _input, _log, _clientName); <<<<<<< } catch (AcmeClient.AcmeWebException awe) { Environment.ExitCode = awe.HResult; _log.Debug("AcmeWebException {@awe}", awe); _log.Error(awe, "ACME Server Returned: {acmeWebExceptionMessage} - Response: {acmeWebExceptionResponse}", awe.Message, awe.Response.ContentAsString); } catch (AcmeException ae) { Environment.ExitCode = ae.HResult; _log.Debug("AcmeException {@ae}", ae); _log.Error(ae, "AcmeException {@ae}", ae.Message); } catch (Exception e) { ======= } catch (Exception e) { HandleException(e); >>>>>>> } catch (Exception e) { HandleException(e); <<<<<<< /// <summary> /// Present user with the option to close the program /// Useful to keep the console output visible when testing /// unattended commands /// </summary> ======= private static void HandleException(Exception ex) { _log.Debug($"{ex.GetType().Name}: {{@e}}", ex); _log.Error($"{ex.GetType().Name}: {{e}}", ex.Message); } >>>>>>> private static void HandleException(Exception ex) { _log.Debug($"{ex.GetType().Name}: {{@e}}", ex); _log.Error($"{ex.GetType().Name}: {{e}}", ex.Message); } /// <summary> /// Present user with the option to close the program /// Useful to keep the console output visible when testing /// unattended commands /// </summary> <<<<<<< _log.Error("Create certificate {target} failed: {message}", target, result.ErrorMessage); ======= _log.Error("Create certificate failed", target); >>>>>>> _log.Error("Create certificate failed"); <<<<<<< _log.Error(ex, "Unknown failure"); if (result == null) ======= HandleException(ex); result.Success = false; result.ErrorMessage = ex.Message; } return result; } /// <summary> /// Save certificate in the right place, either to the certifcate store /// or to the central ssl store /// </summary> /// <param name="bindings">For which bindings is this certificate meant</param> /// <param name="certificate">The certificate itself</param> /// <param name="certificatePfx">The location of the PFX file in the local filesystem.</param> /// <param name="store">Certificate store to use when saving to one</param> public static X509Store SaveCertificate(List<string> bindings, X509Certificate2 certificate, FileInfo certificatePfx = null) { if (_options.CentralSsl) { _log.Information("Copying certificate to the Central SSL store"); _centralSslService.InstallCertificate(bindings, certificate, certificatePfx); return null; } else { _log.Information("Installing certificate in the certificate store"); return _certificateStoreService.InstallCertificate(certificate); } } /// <summary> /// Remove certificate from Central SSL store or Certificate store /// </summary> /// <param name="thumbprint"></param> /// <param name="store"></param> public static void DeleteCertificate(string thumbprint) { if (_options.CentralSsl) { _log.Information("Removing certificate from the Central SSL store"); _centralSslService.UninstallCertificate(thumbprint); } else { _log.Information("Uninstalling certificate from the certificate store"); _certificateStoreService.UninstallCertificate(thumbprint); } } /// <summary> /// Find the most recently issued certificate for a specific target /// </summary> /// <param name="target"></param> /// <returns></returns> public static X509Certificate2 FindCertificate(ScheduledRenewal scheduled) { if (scheduled == null) { return null; } var thumbprint = scheduled.History. OrderByDescending(x => x.Date). Where(x => x.Success). Select(x => x.Thumbprint). FirstOrDefault(); var friendlyName = scheduled.Binding.Host; var useThumbprint = !string.IsNullOrEmpty(thumbprint); if (!_options.CentralSsl) { if (useThumbprint) >>>>>>> HandleException(ex); if (result == null)
<<<<<<< using Windows.Storage; using Windows.UI.Core; ======= using Windows.Storage; >>>>>>> using Windows.Storage; using Windows.UI.Core; <<<<<<< if (ApplicationData.Current.LocalSettings.Values.ContainsKey("SendCloudClipboard")) { if (bool.TryParse(ApplicationData.Current.LocalSettings.Values["SendCloudClipboard"].ToString(), out bool scc)) sendCloudClipboard = scc; } ======= if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("TypeBasedDownloadFolder")) ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] = false; typeBasedDownloadFolderToggle = (ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] as bool?) ?? false; InitDownloadLocation(); >>>>>>> if (ApplicationData.Current.LocalSettings.Values.ContainsKey("SendCloudClipboard")) { if (bool.TryParse(ApplicationData.Current.LocalSettings.Values["SendCloudClipboard"].ToString(), out bool scc)) sendCloudClipboard = scc; } if (!ApplicationData.Current.LocalSettings.Values.ContainsKey("TypeBasedDownloadFolder")) ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] = false; typeBasedDownloadFolderToggle = (ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] as bool?) ?? false; InitDownloadLocation(); <<<<<<< private bool sendCloudClipboard = false; public bool SendCloudClipboard { get { return sendCloudClipboard; } set { SetSendCloudClipboardValue(value); #if !DEBUG App.Tracker.Send(HitBuilder.CreateCustomEvent("Settings", "SendCloudClipboard", value ? "activated" : "deactivated").Build()); #endif } } private async void SetSendCloudClipboardValue(bool value) { SendCloudClipboardProgressRingActive = true; SendCloudClipboardEnabled = false; sendCloudClipboard = value; ApplicationData.Current.LocalSettings.Values["SendCloudClipboard"] = value.ToString(); OnPropertyChanged("SendCloudClipboard"); if (value == true) { await PCExtensionHelper.StartPCExtension(); } else { await PCExtensionHelper.StopPCExtensionIfRunning(); SendCloudClipboardProgressRingActive = false; SendCloudClipboardEnabled = true; } } private bool sendCloudClipboardEnabled = true; public bool SendCloudClipboardEnabled { get { return sendCloudClipboardEnabled; } set { sendCloudClipboardEnabled = value; OnPropertyChanged("SendCloudClipboardEnabled"); } } private bool sendCloudClipboardProgressRingActive = false; public bool SendCloudClipboardProgressRingActive { get { return sendCloudClipboardProgressRingActive; } private set { sendCloudClipboardProgressRingActive = value; OnPropertyChanged("SendCloudClipboardProgressRingActive"); } } private async void PCExtension_AccountIdSet(object sender, EventArgs e) { await DispatcherEx.RunOnCoreDispatcherIfPossible(() => { SendCloudClipboardProgressRingActive = false; SendCloudClipboardEnabled = true; }); } private async void PCExtension_LoginFailed(object sender, EventArgs e) { await DispatcherEx.RunOnCoreDispatcherIfPossible(() => { SendCloudClipboard = false; }); } public void Dispose() { App.PCExtensionAccountIdSet -= PCExtension_AccountIdSet; App.PCExtensionLoginFailed -= PCExtension_LoginFailed; } ======= private string defaultDownloadLocation = ""; public string DefaultDownloadLocation { get { return defaultDownloadLocation; } set { defaultDownloadLocation = value; OnPropertyChanged("DefaultDownloadLocation"); } } private bool typeBasedDownloadFolderToggle = false; public bool TypeBasedDownloadFolderToggle { get { return typeBasedDownloadFolderToggle; } set { typeBasedDownloadFolderToggle = value; ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] = value; OnPropertyChanged("TypeBasedDownloadFolderToggle"); #if !DEBUG App.Tracker.Send(HitBuilder.CreateCustomEvent("Settings", "TypeBasedDownloadFolderToggle", value ? "activated" : "deactivated").Build()); #endif } } >>>>>>> private bool sendCloudClipboard = false; public bool SendCloudClipboard { get { return sendCloudClipboard; } set { SetSendCloudClipboardValue(value); #if !DEBUG App.Tracker.Send(HitBuilder.CreateCustomEvent("Settings", "SendCloudClipboard", value ? "activated" : "deactivated").Build()); #endif } } private async void SetSendCloudClipboardValue(bool value) { SendCloudClipboardProgressRingActive = true; SendCloudClipboardEnabled = false; sendCloudClipboard = value; ApplicationData.Current.LocalSettings.Values["SendCloudClipboard"] = value.ToString(); OnPropertyChanged("SendCloudClipboard"); if (value == true) { await PCExtensionHelper.StartPCExtension(); } else { await PCExtensionHelper.StopPCExtensionIfRunning(); SendCloudClipboardProgressRingActive = false; SendCloudClipboardEnabled = true; } } private bool sendCloudClipboardEnabled = true; public bool SendCloudClipboardEnabled { get { return sendCloudClipboardEnabled; } set { sendCloudClipboardEnabled = value; OnPropertyChanged("SendCloudClipboardEnabled"); } } private bool sendCloudClipboardProgressRingActive = false; public bool SendCloudClipboardProgressRingActive { get { return sendCloudClipboardProgressRingActive; } private set { sendCloudClipboardProgressRingActive = value; OnPropertyChanged("SendCloudClipboardProgressRingActive"); } } private async void PCExtension_AccountIdSet(object sender, EventArgs e) { await DispatcherEx.RunOnCoreDispatcherIfPossible(() => { SendCloudClipboardProgressRingActive = false; SendCloudClipboardEnabled = true; }); } private async void PCExtension_LoginFailed(object sender, EventArgs e) { await DispatcherEx.RunOnCoreDispatcherIfPossible(() => { SendCloudClipboard = false; }); } public void Dispose() { App.PCExtensionAccountIdSet -= PCExtension_AccountIdSet; App.PCExtensionLoginFailed -= PCExtension_LoginFailed; } private string defaultDownloadLocation = ""; public string DefaultDownloadLocation { get { return defaultDownloadLocation; } set { defaultDownloadLocation = value; OnPropertyChanged("DefaultDownloadLocation"); } } private bool typeBasedDownloadFolderToggle = false; public bool TypeBasedDownloadFolderToggle { get { return typeBasedDownloadFolderToggle; } set { typeBasedDownloadFolderToggle = value; ApplicationData.Current.LocalSettings.Values["TypeBasedDownloadFolder"] = value; OnPropertyChanged("TypeBasedDownloadFolderToggle"); #if !DEBUG App.Tracker.Send(HitBuilder.CreateCustomEvent("Settings", "TypeBasedDownloadFolderToggle", value ? "activated" : "deactivated").Build()); #endif } }
<<<<<<< ======= public string ToStepString() { return generator.AttributeStepString(this); } public string Assignment() { return generator.AttributeDataAssignment(this); } public string Allocation(){ return generator.AttributeDataAllocation(this); } >>>>>>> public string ToStepString() { return generator.AttributeStepString(this); } <<<<<<< ======= public string StepProperties() { var attrs = Attributes.Where(a=>!a.IsDerived); if(!attrs.Any()) { return string.Empty; } var propBuilder = new StringBuilder(); propBuilder.AppendLine(); foreach(var a in attrs) { var prop = a.ToStepString(); if(!string.IsNullOrEmpty(prop)) { propBuilder.Append(prop); } } return propBuilder.ToString(); } internal IEnumerable<AttributeData> AttributesWithOptional(IEnumerable<AttributeData> ad) { return ad .Where(a=>!a.IsInverse) .Where(a=>!a.IsDerived); } internal IEnumerable<AttributeData> AttributesWithoutOptional(IEnumerable<AttributeData> ad) { return ad .Where(a=>!a.IsInverse) .Where(a=>!a.IsDerived) .Where(a=>!a.IsOptional); } public string Assignments(bool includeOptional) { var attrs = includeOptional?AttributesWithOptional(Attributes):AttributesWithoutOptional(Attributes); if(!attrs.Any()) { return string.Empty; } var assignBuilder = new StringBuilder(); foreach(var a in attrs) { var assign = a.Assignment(); if(!string.IsNullOrEmpty(assign)) { assignBuilder.Append(assign); } } return assignBuilder.ToString(); } public string Allocations(){ var allocBuilder = new StringBuilder(); foreach(var a in Attributes.Where(a=>!a.IsDerived)){ var alloc = a.Allocation(); if(!string.IsNullOrEmpty(alloc)){ allocBuilder.Append(alloc); } } return allocBuilder.ToString(); } >>>>>>> public string StepProperties() { var attrs = Attributes.Where(a=>!a.IsDerived); if(!attrs.Any()) { return string.Empty; } var propBuilder = new StringBuilder(); propBuilder.AppendLine(); foreach(var a in attrs) { var prop = a.ToStepString(); if(!string.IsNullOrEmpty(prop)) { propBuilder.Append(prop); } } return propBuilder.ToString(); }
<<<<<<< 修改标识:Senparc - 20170122 修改描述:v4.12.2 修复HttpUtility.UrlEncode方法错误 ----------------------------------------------------------*/ ======= 修改标识:Senparc - 20170730 修改描述:v4.13.3 为RequestUtility.HttpGet()方法添加Accept、UserAgent、KeepAlive设置 ----------------------------------------------------------------*/ >>>>>>> 修改标识:Senparc - 20170730 修改描述:v4.13.3 为RequestUtility.HttpGet()方法添加Accept、UserAgent、KeepAlive设置 ----------------------------------------------------------------*/ 修改标识:Senparc - 20170122 修改描述:v4.12.2 修复HttpUtility.UrlEncode方法错误 ----------------------------------------------------------*/
<<<<<<< ======= using System.Web; using Senparc.Weixin.Helpers.StringHelper; >>>>>>> using Senparc.Weixin.Helpers.StringHelper;
<<<<<<< 修改标识:Senparc - 20170213 修改描述:v14.3.123 修复微信支付 "TotalFee" 类型错误[decimal→int] ======= 修改标识:Senparc - 20170211 修改描述:v14.3.125 重新调整sign_type设置顺序,v14.3.122版本中不应该做调整 >>>>>>> 修改标识:Senparc - 20170211 修改描述:v14.3.125 重新调整sign_type设置顺序,v14.3.122版本中不应该做调整 修改标识:Senparc - 20170213 修改描述:v14.3.123 修复微信支付 "TotalFee" 类型错误[decimal→int]
<<<<<<< linker.Link(LinkType.AbsoluteAddress, PatchType.I4, SectionKind.Text, MethodName, pos, symbol, referenceOffset); ======= // Otherwise create the symbol in the expected section if (symbol == null) { symbol = linker.GetSymbol(symbolOperand.Name, section); } linker.Link(LinkType.AbsoluteAddress, PatchType.I4, MethodName, SectionKind.Text, pos, 0, symbol, 0); >>>>>>> // Otherwise create the symbol in the expected section if (symbol == null) { symbol = linker.GetSymbol(symbolOperand.Name, section); } linker.Link(LinkType.AbsoluteAddress, PatchType.I4, SectionKind.Text, MethodName, pos, symbol, referenceOffset);
<<<<<<< 文件名:ResponseHandler.cs 文件功能描述:微信支付V3 响应处理 创建标识:Senparc - 20150211 修改标识:Senparc - 20150303 修改描述:整理接口 修改标识:Senparc - 20161015 修改描述:修改GB2312编码为936 ======= 文件名:ResponseHandler.cs 文件功能描述:微信支付 响应处理 创建标识:Senparc - 20150722 修改标识:Senparc - 20170623 修改描述:使用 ASCII 字典排序 >>>>>>> 文件名:ResponseHandler.cs 文件功能描述:微信支付V3 响应处理 创建标识:Senparc - 20150211 修改标识:Senparc - 20150303 修改描述:整理接口 修改标识:Senparc - 20161015 修改描述:修改GB2312编码为936 修改标识:Senparc - 20170623 修改描述:使用 ASCII 字典排序
<<<<<<< 修改标识:Senparc - 20170617 修改描述:v4.12.3 提供对企业微信的支持:添加WorkJsonResult(企业微信返回消息基类)、ReturnCode_Work(枚举) ======= 修改标识:Senparc - 20170328 修改描述:v4.12.1 添加【ReturnCode.小程序Appid不存在】枚举类型(invalid weapp appid,40166) >>>>>>> 修改标识:Senparc - 20170328 修改描述:v4.12.1 添加【ReturnCode.小程序Appid不存在】枚举类型(invalid weapp appid,40166) 修改标识:Senparc - 20170617 修改描述:v4.12.3 提供对企业微信的支持:添加WorkJsonResult(企业微信返回消息基类)、ReturnCode_Work(枚举)
<<<<<<< /// <summary> /// Constructs a finger. /// /// Generally, you should not create your own finger objects. Such objects will not /// have valid tracking data. Get valid finger objects from a hand in a frame /// received from the service. /// @since 3.0 /// </summary> ======= /** * Constructs a finger. * * Generally, you should not create your own finger objects. Such objects will not * have valid tracking data. Get valid finger objects from a hand in a frame * received from the service. * * @param frameId The id of the frame this finger appears in. * @param handId The id of the hand this finger belongs to. * @param fingerId The id of this finger (handId + 0-4 for finger position). * @param timeVisible How long this instance of the finger has been visible. * @param tipPosition The position of the finger tip. * @param direction The pointing direction of the finger. * @param width The average width of the finger. * @param length The length of the finger. * @param isExtended Whether the finger is more-or-less straight. * @param type The finger name. * @param metacarpal The first bone of the finger (inside the hand). * @param proximal The second bone of the finger * @param intermediate The third bone of the finger. * @param distal The end bone. * @since 3.0 */ >>>>>>> /// <summary> /// Constructs a finger. /// /// Generally, you should not create your own finger objects. Such objects will not /// have valid tracking data. Get valid finger objects from a hand in a frame /// received from the service. /// @since 3.0 /// </summary> <<<<<<< /// <summary> /// The rate of change of the tip position of this finger. /// @since 1.0 /// </summary> public Vector TipVelocity; /// <summary> /// The direction in which this finger or tool is pointing. The direction is expressed /// as a unit vector pointing in the same direction as the tip. /// @since 1.0 /// </summary> ======= /** * The direction in which this finger or tool is pointing. * * \include Finger_direction.txt * * The direction is expressed as a unit vector pointing in the same * direction as the tip. * * \image html images/Leap_Finger_Model.png * * @returns The Vector pointing in the same direction as the tip of this * Finger object. * @since 1.0 */ >>>>>>> /// <summary> /// The direction in which this finger or tool is pointing. The direction is expressed /// as a unit vector pointing in the same direction as the tip. /// @since 1.0 /// </summary> <<<<<<< /// <summary> /// The stabilized tip position of this Finger. /// /// Smoothing and stabilization is performed in order to make /// this value more suitable for interaction with 2D content. The stabilized /// position lags behind the tip position by a variable amount, depending /// primarily on the speed of movement. /// /// @since 1.0 /// </summary> public Vector StabilizedTipPosition; /// <summary> /// The duration of time this Finger has been visible to the Leap Motion Controller. /// @since 1.0 /// </summary> ======= /** * The duration of time this Finger has been visible to the Leap Motion Controller. * * \include Finger_timeVisible.txt * * @returns The duration (in seconds) that this Finger has been tracked. * @since 1.0 */ >>>>>>> /// <summary> /// The duration of time this Finger has been visible to the Leap Motion Controller. /// @since 1.0 /// </summary>
<<<<<<< TestAngleCode(); ======= Debug.Log("Eulers: " + FreezeX + " " + FreezeY + " " + FreezeZ + " " + startingEulers + " " + targetEulers + " " + transform.localEulerAngles); >>>>>>> TestAngleCode(); Debug.Log("Eulers: " + FreezeX + " " + FreezeY + " " + FreezeZ + " " + startingEulers + " " + targetEulers + " " + transform.localEulerAngles); <<<<<<< void TestAngleCode(){ Vector3 target = new Vector3(Mathf.Cos(TargetAngle * Mathf.Deg2Rad), 0, Mathf.Sin(TargetAngle * Mathf.Deg2Rad)); Vector3 min = new Vector3(Mathf.Cos((TargetAngle - Min) * Mathf.Deg2Rad), 0, Mathf.Sin((TargetAngle - Min) * Mathf.Deg2Rad)); Vector3 max = new Vector3(Mathf.Cos((TargetAngle + Max) * Mathf.Deg2Rad), 0, Mathf.Sin((TargetAngle + Max) * Mathf.Deg2Rad)); float testAngle = ClampAngle(InputAngle, TargetAngle - Min, TargetAngle + Max); Vector3 test = new Vector3(Mathf.Cos(testAngle * Mathf.Deg2Rad), 0, Mathf.Sin(testAngle * Mathf.Deg2Rad)); Debug.DrawLine(Vector3.zero, target, Color.blue); Debug.DrawLine(Vector3.zero, min, Color.yellow); Debug.DrawLine(Vector3.zero, max, Color.red); Debug.DrawLine(Vector3.zero, test, Color.green); } ======= //float normalizeAngle (float angle) { //} >>>>>>> void TestAngleCode(){ Vector3 target = new Vector3(Mathf.Cos(TargetAngle * Mathf.Deg2Rad), 0, Mathf.Sin(TargetAngle * Mathf.Deg2Rad)); Vector3 min = new Vector3(Mathf.Cos((TargetAngle - Min) * Mathf.Deg2Rad), 0, Mathf.Sin((TargetAngle - Min) * Mathf.Deg2Rad)); Vector3 max = new Vector3(Mathf.Cos((TargetAngle + Max) * Mathf.Deg2Rad), 0, Mathf.Sin((TargetAngle + Max) * Mathf.Deg2Rad)); float testAngle = ClampAngle(InputAngle, TargetAngle - Min, TargetAngle + Max); Vector3 test = new Vector3(Mathf.Cos(testAngle * Mathf.Deg2Rad), 0, Mathf.Sin(testAngle * Mathf.Deg2Rad)); Debug.DrawLine(Vector3.zero, target, Color.blue); Debug.DrawLine(Vector3.zero, min, Color.yellow); Debug.DrawLine(Vector3.zero, max, Color.red); Debug.DrawLine(Vector3.zero, test, Color.green); } //float normalizeAngle (float angle) { //}
<<<<<<< /// <summary> /// Constructs a new Frame. /// @since 3.0 /// </summary> public Frame(long id, long timestamp, float fps, InteractionBox interactionBox, List<Hand> hands) { ======= /** * Constructs a new Frame. * * @param id The id of this frame. * @param timestamp The creation time of this frame in microseconds. * @param fps The current data frame rate of the service when this frame was created. * @since 3.0 */ public Frame(long id, long timestamp, float fps, List<Hand> hands) { >>>>>>> /// <summary> /// Constructs a new Frame. /// @since 3.0 /// </summary> public Frame(long id, long timestamp, float fps, List<Hand> hands) { <<<<<<< public InteractionBox InteractionBox; /// <summary> /// Resizes the Hand list to have a specific size. If the size is decreased, /// the removed hands are placed into the hand pool. If the size is increased, the /// new spaces are filled with hands taken from the hand pool. If the pool is /// empty, new hands are constructed instead. /// </summary> ======= public int SerializeLength { get { return 0; } } /** * Resizes the Hand list to have a specific size. If the size is decreased, * the removed hands are placed into the hand pool. If the size is increased, the * new spaces are filled with hands taken from the hand pool. If the pool is * empty, new hands are constructed instead. */ >>>>>>> /// <summary> /// Resizes the Hand list to have a specific size. If the size is decreased, /// the removed hands are placed into the hand pool. If the size is increased, the /// new spaces are filled with hands taken from the hand pool. If the pool is /// empty, new hands are constructed instead. /// </summary>
<<<<<<< /// <summary> /// If this Maybe has a value, returns the value, otherwise returns the argument /// custom default value. /// </summary> public T ValueOr(T customDefault) { if (hasValue) { return _t; } else { return customDefault; } } /// <summary> /// Returns this Maybe if it has a value, otherwise returns the argument Maybe value. /// Useful for overlaying multiple Maybe values. /// For example, if I want to overlay a "maybe override font" variable with /// another "maybe override font" variable, I can call: /// this.font = other.font.ValueOr(this.font); /// </summary> public Maybe<T> ValueOr(Maybe<T> maybeCustomDefault) { if (hasValue) { return this; } else { return maybeCustomDefault; } } public QueryWrapper<T, Maybe<T>.MaybeOp> Query() { return new QueryWrapper<T, MaybeOp>(new MaybeOp(this)); ======= public Query<T> Query() { if (hasValue) { return Values.Single(_t); } else { return Values.Empty<T>(); } >>>>>>> /// <summary> /// If this Maybe has a value, returns the value, otherwise returns the argument /// custom default value. /// </summary> public T ValueOr(T customDefault) { if (hasValue) { return _t; } else { return customDefault; } } /// <summary> /// Returns this Maybe if it has a value, otherwise returns the argument Maybe value. /// Useful for overlaying multiple Maybe values. /// For example, if I want to overlay a "maybe override font" variable with /// another "maybe override font" variable, I can call: /// this.font = other.font.ValueOr(this.font); /// </summary> public Maybe<T> ValueOr(Maybe<T> maybeCustomDefault) { if (hasValue) { return this; } else { return maybeCustomDefault; } } public Query<T> Query() { if (hasValue) { return Values.Single(_t); } else { return Values.Empty<T>(); }
<<<<<<< /// <summary> /// Variable to keep track of previous button text incase the button text changes after registration. /// </summary> private string prevButtonText; ======= /// <summary> /// The final keyword that is registered with the Keyword Manager /// </summary> private string keyWord; >>>>>>> /// <summary> /// Variable to keep track of previous button text incase the button text changes after registration. /// </summary> private string prevButtonText; /// <summary> /// The final keyword that is registered with the Keyword Manager /// </summary> private string keyWord; <<<<<<< public void Update() { // Check if Button text has changed. If so, remove previous keyword and add new button text if (KeywordSource == KeywordSourceEnum.ButtonText && prevButtonText != null && GetComponent<CompoundButtonText>().Text != prevButtonText) { KeywordManager.Instance.RemoveKeyword(prevButtonText, KeywordHandler); prevButtonText = GetComponent<CompoundButtonText>().Text; KeywordManager.Instance.AddKeyword(prevButtonText, new KeywordManager.KeywordRecognizedDelegate(KeywordHandler), ConfidenceLevel); } } ======= private void OnDestroy() { // Unregister callback and keyword when this script is destroyed KeywordManager.Instance.RemoveKeyword(this.keyWord, KeywordHandler); } >>>>>>> public void Update() { // Check if Button text has changed. If so, remove previous keyword and add new button text if (KeywordSource == KeywordSourceEnum.ButtonText && prevButtonText != null && GetComponent<CompoundButtonText>().Text != prevButtonText) { KeywordManager.Instance.RemoveKeyword(prevButtonText, KeywordHandler); prevButtonText = GetComponent<CompoundButtonText>().Text; KeywordManager.Instance.AddKeyword(prevButtonText, new KeywordManager.KeywordRecognizedDelegate(KeywordHandler), ConfidenceLevel); } } private void OnDestroy() { // Unregister callback and keyword when this script is destroyed KeywordManager.Instance.RemoveKeyword(this.keyWord, KeywordHandler); }
<<<<<<< ======= internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string BaseVersion = "2.7"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string PublicKeyToken = "ba83ff368b7563c6"; } >>>>>>>
<<<<<<< using System.Collections.Generic; using System.Linq; ======= using Xceed.Wpf.Toolkit.Core.Utilities; >>>>>>> using Xceed.Wpf.Toolkit.Core.Utilities; using System.Collections.Generic; using System.Linq;
<<<<<<< public Type HasAttribute { get; set; } ======= private IList _targetProperties; #endregion #region PropertyDefinitions public PropertyDefinitionCollection PropertyDefinitions { get { return _propertyDefinitions; } set { this.ThrowIfLocked( () => this.PropertyDefinitions ); _propertyDefinitions = value; } } private PropertyDefinitionCollection _propertyDefinitions; #endregion //PropertyDefinitions #endregion #region Overrides >>>>>>> private IList _targetProperties; #endregion public Type HasAttribute { get; set; } #region PropertyDefinitions public PropertyDefinitionCollection PropertyDefinitions { get { return _propertyDefinitions; } set { this.ThrowIfLocked( () => this.PropertyDefinitions ); _propertyDefinitions = value; } } private PropertyDefinitionCollection _propertyDefinitions; #endregion //PropertyDefinitions #endregion #region Overrides
<<<<<<< using System.ComponentModel; ======= using Xceed.Wpf.DataGrid.Views; >>>>>>> using Xceed.Wpf.DataGrid.Views; using System.ComponentModel;
<<<<<<< using System.Collections.Specialized; ======= using System.Collections.ObjectModel; >>>>>>> using System.Collections.ObjectModel; using System.Collections.Specialized; <<<<<<< using Xceed.Wpf.Toolkit.PropertyGrid.Attributes; using Xceed.Wpf.Toolkit.PropertyGrid.Converters; ======= >>>>>>> using Xceed.Wpf.Toolkit.PropertyGrid.Converters;
<<<<<<< ======= internal static class _XceedVersionInfo { [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string BaseVersion = "2.5"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string Version = BaseVersion + ".0.0"; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )] public const string PublicKeyToken = "ba83ff368b7563c6"; } >>>>>>>
<<<<<<< using System.Windows.Automation.Peers; ======= using System.ComponentModel; >>>>>>> using System.ComponentModel; using System.Windows.Automation.Peers;
<<<<<<< _logger = LogManager.GetLogger(nameof(BlockExecutor)); ======= >>>>>>> <<<<<<< Rollback(block, txnRes).ConfigureAwait(false); ======= // TODO, no wait may need improve Rollback(block, txnRes).ConfigureAwait(false); >>>>>>> // TODO, no wait may need improve Rollback(block, txnRes).ConfigureAwait(false); <<<<<<< ======= >>>>>>> <<<<<<< if (res.IsFailed()) _logger?.Warn(errorLog); ======= if (!res) _logger?.Warn(errlog); >>>>>>> if (res.IsFailed()) _logger?.Warn(errorLog); <<<<<<< if (res.IsFailed()) throw new InvalidBlockException(errorLog); return res; ======= if (!res) throw new InvalidBlockException(errlog); >>>>>>> if (res.IsFailed()) throw new InvalidBlockException(errorLog); return res; <<<<<<< txRes.Where(x => x.Status == Status.Mined).Select(x => x.TransactionId), block.Header.GetDisambiguationHash() ======= txRes.Where(x => x.Status == Status.Mined).Select(x => x.TransactionId), block.Header.GetDisambiguationHash() >>>>>>> txRes.Where(x => x.Status == Status.Mined).Select(x => x.TransactionId), block.Header.GetDisambiguationHash() <<<<<<< ======= >>>>>>>
<<<<<<< await Task.Yield(); if (cancellationToken.IsCancellationRequested && isCancellable) ======= if (isCancellable && cancellationToken.IsCancellationRequested) >>>>>>> await Task.Yield(); if (isCancellable && cancellationToken.IsCancellationRequested) <<<<<<< await executive.ApplyAsync(txCtxt); await ExecuteInlineTransactions(depth, currentBlockTime, txCtxt, internalStateCache, ======= await executive.ApplyAsync(txContext); await ExecuteInlineTransactions(depth, currentBlockTime, txContext, internalStateCache, >>>>>>> await executive.ApplyAsync(txContext); await ExecuteInlineTransactions(depth, currentBlockTime, txContext, internalStateCache, <<<<<<< bool isSuccess = await ExecutePluginOnPostTransactionStageAsync(executive, txCtxt, currentBlockTime, internalChainContext, internalStateCache, cancellationToken); if (!isSuccess) ======= if (!await ExecutePluginOnPostTransactionStageAsync(executive, txContext, currentBlockTime, internalChainContext, internalStateCache, cancellationToken)) >>>>>>> if (!await ExecutePluginOnPostTransactionStageAsync(executive, txContext, currentBlockTime, internalChainContext, internalStateCache, cancellationToken)) <<<<<<< TransactionTrace inlineTrace = null; try { inlineTrace = await ExecuteOneAsync(depth + 1, internalChainContext, inlineTx, currentBlockTime, cancellationToken, txCtxt.Origin).WithCancellation(cancellationToken); } catch(OperationCanceledException) { break; } ======= var inlineTrace = await ExecuteOneAsync(depth + 1, internalChainContext, inlineTx, currentBlockTime, cancellationToken, txContext.Origin); >>>>>>> TransactionTrace inlineTrace = null; try { inlineTrace = await ExecuteOneAsync(depth + 1, internalChainContext, inlineTx, currentBlockTime, cancellationToken, txContext.Origin).WithCancellation(cancellationToken); } catch(OperationCanceledException) { break; } <<<<<<< IEnumerable<Transaction> transactions = null; transactions = await plugin.GetPreTransactionsAsync(executive.Descriptors, txCtxt); ======= var transactions = await plugin.GetPreTransactionsAsync(executive.Descriptors, txContext); >>>>>>> var transactions = await plugin.GetPreTransactionsAsync(executive.Descriptors, txContext); <<<<<<< if (cancellationToken.IsCancellationRequested) return false; var transactions = await plugin.GetPostTransactionsAsync(executive.Descriptors, txCtxt); ======= var transactions = await plugin.GetPostTransactionsAsync(executive.Descriptors, txContext); >>>>>>> var transactions = await plugin.GetPostTransactionsAsync(executive.Descriptors, txContext);
<<<<<<< _smartContractManager = smartContractManager; ======= _accountManager = accountManager; _smartContractService = smartContractManager; >>>>>>> _smartContractService = smartContractManager; <<<<<<< var smartContract = await _smartContractManager.GetAsync(tx.To.GetAddress(), chain); ======= var smartContract = await _smartContractService.GetAsync(tx.To.GetAddress(), chain); >>>>>>> var smartContract = await _smartContractService.GetAsync(tx.To.GetAddress(), chain);
<<<<<<< await Task.Yield(); // if (cancellationToken.IsCancellationRequested && isCancellable) // { // return new TransactionTrace // { // TransactionId = transaction.GetHash(), // ExecutionStatus = ExecutionStatus.Canceled, // Error = "Execution cancelled" // }; // } Logger.LogTrace("###====### smart contract prepared"); ======= if (cancellationToken.IsCancellationRequested && isCancellable) { return new TransactionTrace { TransactionId = transaction.GetHash(), ExecutionStatus = ExecutionStatus.Canceled, Error = "Execution cancelled" }; } >>>>>>> await Task.Yield(); if (cancellationToken.IsCancellationRequested && isCancellable) { return new TransactionTrace { TransactionId = transaction.GetHash(), ExecutionStatus = ExecutionStatus.Canceled, Error = "Execution cancelled" }; } <<<<<<< TransactionTrace postTrace; postTrace = await ExecuteOneAsync(0, internalChainContext, postTx, currentBlockTime, cancellationToken).WithCancellation(cancellationToken); // try // { // postTrace = await ExecuteOneAsync(0, internalChainContext, postTx, currentBlockTime, // cancellationToken).WithCancellation(cancellationToken); // } // catch // { // return false; // } ======= var postTrace = await ExecuteOneAsync(0, internalChainContext, postTx, currentBlockTime, cancellationToken, isCancellable: false); >>>>>>> var postTrace = await ExecuteOneAsync(0, internalChainContext, postTx, currentBlockTime, cancellationToken, isCancellable: false);
<<<<<<< using AElf.Kernel.Storages; using AElf.TestBase; ======= >>>>>>> using AElf.Kernel.Storages; using AElf.TestBase; <<<<<<< private IStateStore _stateStore; ======= private IChainContextService _chainContextService; private IChainService _chainService; private ITransactionManager _transactionManager; private IStateManager _stateManager; >>>>>>> private IStateManager _stateManager;
<<<<<<< typeof(MinerAElfModule), typeof(CrosschainAElfModule), ======= typeof(AElf.Miner.MinerAElfModule), typeof(ConsensusKernelAElfModule), typeof(AElf.Miner.Rpc.MinerRpcAElfModule), >>>>>>> typeof(AElf.Miner.MinerAElfModule), typeof(ConsensusKernelAElfModule), typeof(MinerAElfModule), typeof(CrosschainAElfModule),
<<<<<<< var contractAddress = GenesisContractHash(chainId); await _smartContractService.DeployContractAsync(chainId, contractAddress, smartContractRegistration); ======= var contractAddress = new Hash(chainId.CalculateHashWith("__SmartContractZero__")).ToAccount(); await _smartContractService.DeployContractAsync(chainId, contractAddress, smartContractRegistration, true); >>>>>>> var contractAddress = GenesisContractHash(chainId); await _smartContractService.DeployContractAsync(chainId, contractAddress, smartContractRegistration, true);
<<<<<<< var graph = graphObject.graph as UnityEngine.MaterialGraph.MaterialGraph; ======= var graph = inMemoryAsset as IShaderGraph; >>>>>>> var graph = graphObject.graph as IShaderGraph;
<<<<<<< public void SendVirtualInline(Hash fromVirtualAddress, Address toAddress, string methodName, params object[] args) { TransactionContext.Trace.InlineTransactions.Add(new Transaction() { From = ConvertVirtualAddressToContractAddress(fromVirtualAddress), To = toAddress, MethodName = methodName, Params = ByteString.CopyFrom(ParamsPacker.Pack(args)) }); } public Address ConvertVirtualAddressToContractAddress(Hash virtualAddress) { return Address.FromPublicKey(Self.Value.Concat( virtualAddress.Value).ToArray()); } ======= public T Call<T>(IStateCache stateCache, Address address, string methodName, params object[] args) { var svc = _smartContractExecutiveService; var transactionContext = new TransactionContext() { Transaction = new Transaction() { From = this.Self, To = address, MethodName = methodName, Params = ByteString.CopyFrom(ParamsPacker.Pack(args)) } }; var chainContext = new ChainContext() { BlockHash = this.TransactionContext.PreviousBlockHash, BlockHeight = this.TransactionContext.BlockHeight - 1, StateCache = stateCache }; AsyncHelper.RunSync(async () => { var executive = await svc.GetExecutiveAsync(chainContext, address); executive.SetDataCache(stateCache); try { // view only, write actions need to be sent via SendInline await executive.SetTransactionContext(transactionContext).Apply(); } finally { await svc.PutExecutiveAsync(address, executive); } }); if (!transactionContext.Trace.IsSuccessful()) { throw new Exception("Contract reading call failed."); } var decoder = ReturnTypeHelper.GetDecoder<T>(); return decoder(transactionContext.Trace.ReturnValue.ToByteArray()); } >>>>>>> public T Call<T>(IStateCache stateCache, Address address, string methodName, params object[] args) { var svc = _smartContractExecutiveService; var transactionContext = new TransactionContext() { Transaction = new Transaction() { From = this.Self, To = address, MethodName = methodName, Params = ByteString.CopyFrom(ParamsPacker.Pack(args)) } }; var chainContext = new ChainContext() { BlockHash = this.TransactionContext.PreviousBlockHash, BlockHeight = this.TransactionContext.BlockHeight - 1, StateCache = stateCache }; AsyncHelper.RunSync(async () => { var executive = await svc.GetExecutiveAsync(chainContext, address); executive.SetDataCache(stateCache); try { // view only, write actions need to be sent via SendInline await executive.SetTransactionContext(transactionContext).Apply(); } finally { await svc.PutExecutiveAsync(address, executive); } }); if (!transactionContext.Trace.IsSuccessful()) { throw new Exception("Contract reading call failed."); } var decoder = ReturnTypeHelper.GetDecoder<T>(); return decoder(transactionContext.Trace.ReturnValue.ToByteArray()); } public void SendVirtualInline(Hash fromVirtualAddress, Address toAddress, string methodName, params object[] args) { TransactionContext.Trace.InlineTransactions.Add(new Transaction() { From = ConvertVirtualAddressToContractAddress(fromVirtualAddress), To = toAddress, MethodName = methodName, Params = ByteString.CopyFrom(ParamsPacker.Pack(args)) }); } public Address ConvertVirtualAddressToContractAddress(Hash virtualAddress) { return Address.FromPublicKey(Self.Value.Concat( virtualAddress.Value).ToArray()); }
<<<<<<< ======= _logger?.Trace($"Valid block {block.BlockHashToHex}."); >>>>>>>
<<<<<<< using AElf.Miner.TxMemPool; using AElf.SmartContract; ======= >>>>>>> using AElf.Miner.TxMemPool; <<<<<<< private readonly ITxPool _txPool; ======= private readonly IStateStore _stateStore; private readonly ITxPoolService _txPoolService; >>>>>>> private readonly ITxPool _txPool; private readonly IStateStore _stateStore; <<<<<<< private readonly IStateDictator _stateDictator; private readonly IBlockSynchronizor _blockSynchronizor; private readonly IBlockExecutor _blockExecutor; ======= private readonly IBlockSyncService _blockSyncService; private readonly IBlockExecutionService _blockExecutionService; >>>>>>> private readonly IBlockSynchronizor _blockSynchronizor; private readonly IBlockExecutor _blockExecutor; <<<<<<< public MainchainNodeService(ITxPool pool, ======= public MainchainNodeService( IStateStore stateStore, ITxPoolService poolService, IAccountContextService accountContextService, >>>>>>> public MainchainNodeService( IStateStore stateStore, ITxPool pool, <<<<<<< IBlockSynchronizor blockSynchronizor, IStateDictator stateDictator, ======= IBlockSyncService blockSyncService, >>>>>>> IBlockSynchronizor blockSynchronizor, <<<<<<< _stateDictator = stateDictator; _txPool = pool; ======= _txPoolService = poolService; >>>>>>> _txPool = pool; <<<<<<< _consensus = new DPoS(_stateDictator, _txPool, _miner, _chainService); ======= _consensus = new DPoS(_stateStore, _txPoolService, _miner, _chainService); >>>>>>> _consensus = new DPoS(_stateStore, _txPool, _miner, _chainService);
<<<<<<< if (block.Header.Height == KernelConstants.GenesisBlockHeight) ======= if (block.Height == Constants.GenesisBlockHeight) >>>>>>> if (block.Header.Height == Constants.GenesisBlockHeight) <<<<<<< await _crossChainDataProvider.GetIndexedCrossChainBlockDataAsync(block.Header.GetHash(), block.Header.Height); var extraData = _crossChainExtraDataExtractor.ExtractCrossChainData(block.Header); ======= await _crossChainDataProvider.GetIndexedCrossChainBlockDataAsync(block.Header.GetHash(), block.Height); // var indexedCrossChainBlockData = // message == null ? null : CrossChainBlockData.Parser.ParseFrom(message.ToByteString()); var extraData = ExtractCrossChainExtraData(block.Header); >>>>>>> await _crossChainDataProvider.GetIndexedCrossChainBlockDataAsync(block.Header.GetHash(), block.Header.Height); // var indexedCrossChainBlockData = // message == null ? null : CrossChainBlockData.Parser.ParseFrom(message.ToByteString()); var extraData = ExtractCrossChainExtraData(block.Header); <<<<<<< var res = await _crossChainDataProvider.ValidateSideChainBlockDataAsync( crossChainBlockData.SideChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Header.Height - 1) && await _crossChainDataProvider.ValidateParentChainBlockDataAsync( crossChainBlockData.ParentChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Header.Height - 1); ======= var res = await _crossChainDataProvider.ValidateSideChainBlockDataAsync( crossChainBlockData.SideChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Height - 1) && await _crossChainDataProvider.ValidateParentChainBlockDataAsync( crossChainBlockData.ParentChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Height - 1); >>>>>>> var res = await _crossChainDataProvider.ValidateSideChainBlockDataAsync( crossChainBlockData.SideChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Header.Height - 1) && await _crossChainDataProvider.ValidateParentChainBlockDataAsync( crossChainBlockData.ParentChainBlockData.ToList(), block.Header.PreviousBlockHash, block.Header.Height - 1);
<<<<<<< using AElf.OS.BlockSync.Infrastructure; using AElf.OS.Network; ======= >>>>>>> using AElf.OS.Network; <<<<<<< private readonly IBlockSyncStateProvider _blockSyncStateProvider; private readonly ITaskQueueManager _taskQueueManager; private readonly IBlockSyncAttachService _blockSyncAttachService; ======= private readonly IBlockSyncQueueService _blockSyncQueueService; >>>>>>> private readonly IBlockSyncAttachService _blockSyncAttachService; private readonly IBlockSyncQueueService _blockSyncQueueService; <<<<<<< IBlockSyncStateProvider blockSyncStateProvider, ITaskQueueManager taskQueueManager, IBlockSyncAttachService blockSyncAttachService) ======= IBlockSyncQueueService blockSyncQueueService) >>>>>>> IBlockSyncAttachService blockSyncAttachService, IBlockSyncQueueService blockSyncQueueService) <<<<<<< _blockSyncStateProvider = blockSyncStateProvider; _taskQueueManager = taskQueueManager; _blockSyncAttachService = blockSyncAttachService; ======= _blockSyncQueueService = blockSyncQueueService; >>>>>>> _blockSyncAttachService = blockSyncAttachService; _blockSyncQueueService = blockSyncQueueService;
<<<<<<< builder.RegisterModule(new DatabaseModule()); builder.RegisterModule(new LoggerModule()); ======= builder.RegisterModule(new DatabaseModule(new DatabaseConfig())); >>>>>>> builder.RegisterModule(new LoggerModule()); builder.RegisterModule(new DatabaseModule(new DatabaseConfig()));
<<<<<<< using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using AElf.Common; using AElf.Cryptography.ECDSA; using AElf.Execution.Execution; using Google.Protobuf; using Xunit; namespace AElf.Kernel.Tests { public class BlockChainTests { private BlockChainTests_MockSetup _mock; private IExecutingService _executingService; public BlockChainTests(BlockChainTests_MockSetup mock, IExecutingService executingService) { _mock = mock; _executingService = executingService; } //TODO: Recover. [Fact(Skip = "Skip for now.")] public void StateRollbackTest() { var key = new KeyPairGenerator().Generate(); var addresses = Enumerable.Range(0, 10).Select(x => Address.FromString(x.ToString())).ToList(); var txs = addresses.Select(x => _mock.GetInitializeTxn(x, 1)).ToList(); var b1 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b1.Body.Transactions.AddRange(txs.Select(x => x.GetHash())); b1.Body.TransactionList.AddRange(txs); var disHash1 = b1.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(txs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash1); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b1}); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } var tfrs = Enumerable.Range(0, 5) .Select(i => _mock.GetTransferTxn1(addresses[2 * i], addresses[2 * i + 1], 1)).ToList(); var b2 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b2.Body.Transactions.AddRange(tfrs.Select(x => x.GetHash())); b2.Body.TransactionList.AddRange(tfrs); var disHash2 = b2.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(tfrs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash2); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b2}); foreach (var i in Enumerable.Range(0, 5)) { Assert.Equal((ulong) 0, _mock.GetBalance(addresses[2 * i])); Assert.Equal((ulong) 2, _mock.GetBalance(addresses[2 * i + 1])); } _mock.BlockChain.RollbackToHeight(2); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } } } ======= using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using AElf.Common; using AElf.Cryptography.ECDSA; using AElf.Execution.Execution; using Google.Protobuf; using Xunit; using Xunit.Frameworks.Autofac; namespace AElf.Kernel.Tests { [UseAutofacTestFramework] public class BlockChainTests { private readonly BlockChainTests_MockSetup _mock; private readonly IExecutingService _executingService; public BlockChainTests(BlockChainTests_MockSetup mock, IExecutingService executingService) { _mock = mock; _executingService = executingService; } //TODO: Recover. [Fact(Skip = "Skip for now.")] public void StateRollbackTest() { var key = new KeyPairGenerator().Generate(); var addresses = Enumerable.Range(0, 10).Select(x => Address.FromString(x.ToString())).ToList(); var txs = addresses.Select(x => _mock.GetInitializeTxn(x, 1)).ToList(); var b1 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b1.Body.Transactions.AddRange(txs.Select(x => x.GetHash())); b1.Body.TransactionList.AddRange(txs); var disHash1 = b1.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(txs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash1); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b1}); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } var tfrs = Enumerable.Range(0, 5) .Select(i => _mock.GetTransferTxn1(addresses[2 * i], addresses[2 * i + 1], 1)).ToList(); var b2 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b2.Body.Transactions.AddRange(tfrs.Select(x => x.GetHash())); b2.Body.TransactionList.AddRange(tfrs); var disHash2 = b2.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(tfrs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash2); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b2}); foreach (var i in Enumerable.Range(0, 5)) { Assert.Equal((ulong) 0, _mock.GetBalance(addresses[2 * i])); Assert.Equal((ulong) 2, _mock.GetBalance(addresses[2 * i + 1])); } _mock.BlockChain.RollbackToHeight(2); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } } } >>>>>>> using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using AElf.Common; using AElf.Cryptography.ECDSA; using AElf.Execution.Execution; using Google.Protobuf; using Xunit; namespace AElf.Kernel.Tests { public class BlockChainTests { private readonly BlockChainTests_MockSetup _mock; private readonly IExecutingService _executingService; public BlockChainTests(BlockChainTests_MockSetup mock, IExecutingService executingService) { _mock = mock; _executingService = executingService; } //TODO: Recover. [Fact(Skip = "Skip for now.")] public void StateRollbackTest() { var key = new KeyPairGenerator().Generate(); var addresses = Enumerable.Range(0, 10).Select(x => Address.FromString(x.ToString())).ToList(); var txs = addresses.Select(x => _mock.GetInitializeTxn(x, 1)).ToList(); var b1 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b1.Body.Transactions.AddRange(txs.Select(x => x.GetHash())); b1.Body.TransactionList.AddRange(txs); var disHash1 = b1.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(txs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash1); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b1}); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } var tfrs = Enumerable.Range(0, 5) .Select(i => _mock.GetTransferTxn1(addresses[2 * i], addresses[2 * i + 1], 1)).ToList(); var b2 = new Block() { Header = new BlockHeader() { ChainId = _mock.ChainId1, Index = _mock.BlockChain.GetCurrentBlockHeightAsync().Result + 1, PreviousBlockHash = _mock.BlockChain.GetCurrentBlockHashAsync().Result, P = ByteString.CopyFrom(key.PublicKey) }, Body = new BlockBody() }; b2.Body.Transactions.AddRange(tfrs.Select(x => x.GetHash())); b2.Body.TransactionList.AddRange(tfrs); var disHash2 = b2.Header.GetDisambiguationHash(); _executingService.ExecuteAsync(tfrs, _mock.ChainId1, DateTime.UtcNow, CancellationToken.None, disHash2); _mock.BlockChain.AddBlocksAsync(new List<IBlock>() {b2}); foreach (var i in Enumerable.Range(0, 5)) { Assert.Equal((ulong) 0, _mock.GetBalance(addresses[2 * i])); Assert.Equal((ulong) 2, _mock.GetBalance(addresses[2 * i + 1])); } _mock.BlockChain.RollbackToHeight(2); foreach (var addr in addresses) { Assert.Equal((ulong) 1, _mock.GetBalance(addr)); } } }
<<<<<<< private const string GetDeserializedInfo = "get_deserialized_info"; ======= private const string CallReadOnly = "call"; >>>>>>> private const string GetDeserializedInfo = "get_deserialized_info"; private const string CallReadOnly = "call"; <<<<<<< GetBlockInfo, GetDeserializedInfo ======= GetBlockInfo, CallReadOnly >>>>>>> GetBlockInfo, GetDeserializedInfo, CallReadOnly <<<<<<< case GetDeserializedInfo: responseData = ProGetDeserializedInfo(reqParams); break; ======= case CallReadOnly: responseData = await ProcessCallReadOnly(reqParams); break; >>>>>>> case GetDeserializedInfo: responseData = ProGetDeserializedInfo(reqParams); break; case CallReadOnly: responseData = await ProcessCallReadOnly(reqParams); break;
<<<<<<< ValidateContractState(State.ParliamentAuthContract, State.ParliamentAuthContractSystemName.Value); Address organizationAddress = State.ParliamentAuthContract.GetZeroOwnerAddress.Call(new Empty()); ======= ValidateContractState(State.ParliamentAuthContract, SmartContractConstants.ParliamentAuthContractSystemName); Address organizationAddress = State.ParliamentAuthContract.GetDefaultOrganizationAddress.Call(new Empty()); >>>>>>> ValidateContractState(State.ParliamentAuthContract, SmartContractConstants.ParliamentAuthContractSystemName); Address organizationAddress = State.ParliamentAuthContract.GetZeroOwnerAddress.Call(new Empty());
<<<<<<< using AElf.Kernel.Blockchain.Application; using AElf.Kernel.FeeCalculation; ======= using AElf.Kernel.FeeCalculation; using AElf.Kernel.FeeCalculation.Application; >>>>>>> using AElf.Kernel.Blockchain.Application; using AElf.Kernel.FeeCalculation; using AElf.Kernel.FeeCalculation.Application; <<<<<<< using AElf.Kernel.SmartContract.Application; ======= using AElf.Kernel.Txn.Application; >>>>>>> using AElf.Kernel.SmartContract.Application; using AElf.Kernel.Txn.Application; <<<<<<< context.Services.AddTransient<IBlockAcceptedLogEventProcessor, ResourceTokenChargedLogEventProcessor>(); context.Services.AddSingleton<IBlockValidationProvider, DonateResourceTokenValidationProvider>(); ======= context.Services.AddTransient<ITransactionValidationProvider, TxHubEntryPermissionValidationProvider>(); context.Services.AddTransient<ITransactionValidationProvider, TransactionMethodNameValidationProvider>(); context.Services.AddSingleton<IChargeFeeStrategy, TokenContractChargeFeeStrategy>(); >>>>>>> context.Services.AddTransient<IBlockAcceptedLogEventProcessor, ResourceTokenChargedLogEventProcessor>(); context.Services.AddSingleton<IBlockValidationProvider, DonateResourceTokenValidationProvider>(); context.Services.AddTransient<ITransactionValidationProvider, TxHubEntryPermissionValidationProvider>(); context.Services.AddTransient<ITransactionValidationProvider, TransactionMethodNameValidationProvider>(); context.Services.AddSingleton<IChargeFeeStrategy, TokenContractChargeFeeStrategy>();
<<<<<<< Logger.LogTrace($"Pushed {block}, current state {CurrentState}, current head {HeadBlock}"); ======= _logger?.Trace($"Pushed {block}, current state {CurrentState}, current head {HeadBlock}, blockset head {_blockSet.CurrentHead.BlockHash}"); >>>>>>> Logger.LogTrace($"Pushed {block}, current state {CurrentState}, current head {HeadBlock}, blockset head {_blockSet.CurrentHead.BlockHash}"); <<<<<<< await HandleInvalidBlock(block, blockValidationResult); ======= MessageHub.Instance.Publish(new LockMining(false)); _blockSet.RemoveInvalidBlock(block.GetHash()); >>>>>>> MessageHub.Instance.Publish(new LockMining(false)); _blockSet.RemoveInvalidBlock(block.GetHash()); <<<<<<< return BlockExecutionResult.Success; } private Task HandleInvalidBlock(IBlock block, BlockValidationResult blockValidationResult) { Logger.LogWarning( $"Invalid block ({blockValidationResult}) {block}"); MessageHub.Instance.Publish(new LockMining(false)); // Handle the invalid blocks according to their validation results. if ((int) blockValidationResult < 100) { // todo probably wrong algo but the best is to add to cache CacheBlock(block); } return Task.CompletedTask; ======= >>>>>>> <<<<<<< // exec blocks one by one foreach (var block in toexec) { var executionResult = await _blockExecutor.ExecuteBlock(block.GetClonedBlock()); Logger.LogTrace($"Execution of {block} : {executionResult}"); } ======= // exec blocks one by one (skip root of both forks because it's not rollbacked) foreach (var block in toexec.Skip(1)) { var executionResult = await _blockExecutor.ExecuteBlock(block.GetClonedBlock()); _logger?.Trace($"Execution of {block} : {executionResult}"); } >>>>>>> // exec blocks one by one (skip root of both forks because it's not rollbacked) foreach (var block in toexec.Skip(1)) { var executionResult = await _blockExecutor.ExecuteBlock(block.GetClonedBlock()); Logger.LogTrace($"Execution of {block} : {executionResult}"); }
<<<<<<< State.CurrentMiners.Value = minersKeys.ToList().ToMiners(); ======= State.TermNumberFromMainChainField.Value = consensusInformation.Round.TermNumber; State.CurrentMiners.Value = minersKeys.ToMiners(1); >>>>>>> State.TermNumberFromMainChainField.Value = consensusInformation.Round.TermNumber; State.CurrentMiners.Value = minersKeys.ToList().ToMiners(); <<<<<<< if (currentRound.RealTimeMinersInformation.Keys.ToList().ToMiners().GetMinersHash() == State.CurrentMiners.Value.GetMinersHash()) ======= if (State.CurrentMiners.Value == null || currentRound.RealTimeMinersInformation.Keys.ToMiners().GetMinersHash() == State.CurrentMiners.Value.GetMinersHash()) >>>>>>> if (State.CurrentMiners.Value == null || currentRound.RealTimeMinersInformation.Keys.ToList().ToMiners().GetMinersHash() == State.CurrentMiners.Value.GetMinersHash())
<<<<<<< using System.Security.Cryptography; using System.Text; using System.Threading; ======= >>>>>>> using System.Security.Cryptography; using System.Text; using System.Threading; <<<<<<< using AElf.Synchronization.EventMessages; using Base58Check; ======= using AElf.Synchronization.EventMessages; >>>>>>> using AElf.Synchronization.EventMessages; using Base58Check; using AElf.Synchronization.EventMessages; <<<<<<< private IConsensus _consensus; ======= private IBlockChain BlockChain => _blockChain ?? (_blockChain = _chainService.GetBlockChain( Hash.LoadHex(ChainConfig.Instance.ChainId))); private readonly IConsensus _consensus; >>>>>>> private IConsensus _consensus; <<<<<<< } Thread.Sleep(1000); if (NodeConfig.Instance.ConsensusInfoGenerator) { StartMining(); // Start directly. ======= _logger?.Debug($"Coinbase = {_miner.Coinbase.DumpHex()}"); >>>>>>>
<<<<<<< private void OnExit(object sender, ConsoleCancelEventArgs args) ======= private void OnCancelKeyPress(object sender, EventArgs args) >>>>>>> private void OnCancelKeyPress(object sender, EventArgs args) <<<<<<< Logger.Trace("node will be shut down after 5s..."); ======= _logger.Trace("node will be closed after 5s..."); >>>>>>> Logger.Trace("node will be closed after 5s..."); <<<<<<< Logger.Trace("node is shut down."); ======= _logger.Trace("node is closed."); >>>>>>> Logger.Trace("node is closed.");
<<<<<<< var handshake = await _handshakeProvider.GetHandshakeAsync(); var client = CreateClient(ipAddress); ======= var client = CreateClient(endpoint); var connectionInfo = await _connectionInfoProvider.GetConnectionInfoAsync(); ConnectReply connectReply = await CallConnectAsync(client, endpoint, connectionInfo); >>>>>>> var handshake = await _handshakeProvider.GetHandshakeAsync(); var client = CreateClient(endpoint); <<<<<<< var peer = new GrpcPeer(client, ipAddress, new PeerInfo { Pubkey = handshakeReply.Handshake.HandshakeData.Pubkey.ToHex(), ConnectionTime = TimestampHelper.GetUtcNow(), ProtocolVersion = handshakeReply.Handshake.HandshakeData.Version, IsInbound = false }); peer.UpdateLastReceivedHandshake(handshakeReply.Handshake); return peer; ======= return new GrpcPeer(client, endpoint, connectReply.Info.ToPeerInfo(isInbound: false)); >>>>>>> var peer = new GrpcPeer(client, endpoint, new PeerInfo { Pubkey = handshakeReply.Handshake.HandshakeData.Pubkey.ToHex(), ConnectionTime = TimestampHelper.GetUtcNow(), ProtocolVersion = handshakeReply.Handshake.HandshakeData.Version, IsInbound = false }); peer.UpdateLastReceivedHandshake(handshakeReply.Handshake); return peer; <<<<<<< private async Task<HandshakeReply> CallDoHandshakeAsync(GrpcClient client, string ipAddress, Handshake handshake) ======= private async Task<ConnectReply> CallConnectAsync(GrpcClient client, IPEndPoint ipAddress, ConnectionInfo connectionInfo) >>>>>>> private async Task<HandshakeReply> CallDoHandshakeAsync(GrpcClient client, IPEndPoint ipAddress, Handshake handshake)
<<<<<<< public override AddressList GetDeployedContractAddressList(Empty input) { return State.DeployedContractAddressList.Value; } ======= public override Empty ValidateSystemContractAddress(ValidateSystemContractAddressInput input) { var actualAddress = GetContractAddressByName(input.SystemContractHashName); Assert(actualAddress == input.Address, "Address not expected."); return new Empty(); } >>>>>>> public override Empty ValidateSystemContractAddress(ValidateSystemContractAddressInput input) { var actualAddress = GetContractAddressByName(input.SystemContractHashName); Assert(actualAddress == input.Address, "Address not expected."); return new Empty(); } public override AddressList GetDeployedContractAddressList(Empty input) { return State.DeployedContractAddressList.Value; }
<<<<<<< ======= // TODO: Recover test cases of cross chain extra data provider. /* >>>>>>> <<<<<<< var crossChainBlockExtraDataProvider = new CrossChainBlockExtraDataProvider(fakeTransactionResultGettingService); await crossChainBlockExtraDataProvider.FillExtraDataAsync(block); Assert.Null(block.Header.BlockExtraData); ======= var crossChainBlockExtraDataProvider = new CrossChainBlockExtraDataProvider(fakeTransactionResultGettingService); await crossChainBlockExtraDataProvider.FillExtraDataAsync(block.Header); Assert.Null(block.Header.BlockExtraDatas); >>>>>>>
<<<<<<< using AElf.Contracts.MultiToken.Messages; ======= using AElf.Contracts.MultiToken; >>>>>>> using AElf.Contracts.MultiToken; using AElf.Contracts.MultiToken.Messages;
<<<<<<< #region Authorization public const string AElfMultiSig = "__MultiSig__"; #endregion #region PoTC public static ulong ExpectedTransactionCount = 8000; #endregion #region Single node test public static int SingleNodeTestMiningInterval = 4000; #endregion ======= >>>>>>> #region Authorization public const string AElfMultiSig = "__MultiSig__"; #endregion
<<<<<<< private async Task<bool> ValidateCrossChainBlockDataAsync(CrossChainBlockData crossChainBlockData, Hash sideChainTransactionsRoot, Hash preBlockHash, ulong preBlockHeight) ======= private async Task<bool> ValidateCrossChainBlockDataAsync(CrossChainBlockData crossChainBlockData, Hash preBlockHash, long preBlockHeight) >>>>>>> private async Task<bool> ValidateCrossChainBlockDataAsync(CrossChainBlockData crossChainBlockData, Hash sideChainTransactionsRoot, Hash preBlockHash, long preBlockHeight)
<<<<<<< using AElf.Kernel.Managers; ======= >>>>>>> using AElf.Kernel.Managers;
<<<<<<< ChainConfig.Instance.ChainId = chainId.DumpHex(); _contract = new SideChainContractShim(Mock, ContractHelpers.GetCrossChainContractAddress(chainId)); ======= ChainConfig.Instance.ChainId = chainId.DumpBase58(); _contract = new SideChainContractShim(Mock, ContractHelpers.GetSideChainContractAddress(chainId)); >>>>>>> ChainConfig.Instance.ChainId = chainId.DumpBase58(); _contract = new SideChainContractShim(Mock, ContractHelpers.GetCrossChainContractAddress(chainId));
<<<<<<< Task<List<TransactionTrace>> ExecuteAsync(List<Transaction> transactions, Hash chainId, CancellationToken cancellationToken, Hash disambiguationHash = null, TransactionType transactionType = TransactionType.ContractTransaction, bool skipFee=false); ======= Task<List<TransactionTrace>> ExecuteAsync(List<Transaction> transactions, Hash chainId, CancellationToken cancellationToken, DateTime currentBlockTime, Hash disambiguationHash = null, TransactionType transactionType = TransactionType.ContractTransaction); >>>>>>> Task<List<TransactionTrace>> ExecuteAsync(List<Transaction> transactions, Hash chainId, DateTime currentBlockTime, CancellationToken cancellationToken, Hash disambiguationHash = null, TransactionType transactionType = TransactionType.ContractTransaction, bool skipFee=false);
<<<<<<< public class SecretSharingInformationLogEventProcessor : IBlocksExecutionSucceededLogEventProcessor ======= internal class SecretSharingInformationLogEventProcessor : LogEventProcessorBase, IBestChainFoundLogEventProcessor >>>>>>> internal class SecretSharingInformationLogEventProcessor : LogEventProcessorBase, IBlocksExecutionSucceededLogEventProcessor
<<<<<<< _transactionResultManager, clientManager, _binaryMerkleTreeManager, null, MockBlockValidationService().Object, _chainContextService, _chainManager, _stateManager); ======= _transactionResultManager, _logger, clientManager, _binaryMerkleTreeManager, null, MockBlockValidationService().Object, _stateManager); >>>>>>> _transactionResultManager, clientManager, _binaryMerkleTreeManager, null, MockBlockValidationService().Object, _stateManager); <<<<<<< new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, _electionInfo), _chainManager, _stateManager); ======= new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, null, _electionInfo), _stateManager); >>>>>>> new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, _electionInfo), _stateManager);
<<<<<<< using AElf.Contracts.CrossChain; ======= using Acs0; using AElf.Contracts.MultiToken.Messages; >>>>>>> using Acs0;
<<<<<<< "Cg5tZXNzYWdlcy5wcm90byJ7CgtUcmFuc2FjdGlvbhITCgRGcm9tGAEgASgL", "MgUuSGFzaBIRCgJUbxgCIAEoCzIFLkhhc2gSEwoLSW5jcmVtZW50SWQYAyAB", "KAQSEgoKTWV0aG9kTmFtZRgEIAEoCRIOCgZQYXJhbXMYBSABKAwSCwoDRmVl", "GAYgASgEIhUKBEhhc2gSDQoFVmFsdWUYASABKAwiaQoLQmxvY2tIZWFkZXIS", "DwoHVmVyc2lvbhgBIAEoBRIcCg1QZXJ2aW91c0Jsb2NrGAIgASgLMgUuSGFz", "aBIrChxNZXJrbGVUcmVlUm9vdE9mVHJhbnNhY3Rpb25zGAMgASgLMgUuSGFz", "aCJECglCbG9ja0JvZHkSGgoLQmxvY2tIZWFkZXIYASABKAsyBS5IYXNoEhsK", "DFRyYW5zYWN0aW9ucxgCIAMoCzIFLkhhc2giPwoFQmxvY2sSHAoGSGVhZGVy", "GAEgASgLMgwuQmxvY2tIZWFkZXISGAoEQm9keRgCIAEoCzIKLkJsb2NrQm9k", "eSJhChlTbWFydENvbnRyYWN0UmVnaXN0cmF0aW9uEhAKCENhdGVnb3J5GAEg", "ASgFEhsKDENvbnRyYWN0SGFzaBgCIAEoCzIFLkhhc2gSFQoNQ29udHJhY3RC", "eXRlcxgDIAEoDCJPChdTbWFydENvbnRyYWN0RGVwbG95bWVudBIbCgxDb250", "cmFjdEhhc2gYASABKAsyBS5IYXNoEhcKD0NvbnN0cnVjdFBhcmFtcxgCIAEo", "DCJIChpTbWFydENvbnRyYWN0SW52b2tlQ29udGV4dBIVCgZDYWxsZXIYASAB", "KAsyBS5IYXNoEhMKC0luY3JlbWVudElkGAIgASgEQg6qAgtBRWxmLktlcm5l", "bGIGcHJvdG8z")); ======= "Cg5tZXNzYWdlcy5wcm90byKPAQoLVHJhbnNhY3Rpb24SEwoERnJvbRgBIAEo", "CzIFLkhhc2gSEQoCVG8YAiABKAsyBS5IYXNoEhMKC0luY3JlbWVudElkGAMg", "ASgEEhIKCk1ldGhvZE5hbWUYBCABKAkSDgoGUGFyYW1zGAUgASgMEgkKAVIY", "BiABKAwSCQoBUxgHIAEoDBIJCgFQGAggASgMIhUKBEhhc2gSDQoFVmFsdWUY", "ASABKAwiaQoLQmxvY2tIZWFkZXISDwoHVmVyc2lvbhgBIAEoBRIcCg1QZXJ2", "aW91c0Jsb2NrGAIgASgLMgUuSGFzaBIrChxNZXJrbGVUcmVlUm9vdE9mVHJh", "bnNhY3Rpb25zGAMgASgLMgUuSGFzaCJECglCbG9ja0JvZHkSGgoLQmxvY2tI", "ZWFkZXIYASABKAsyBS5IYXNoEhsKDFRyYW5zYWN0aW9ucxgCIAMoCzIFLkhh", "c2giPwoFQmxvY2sSHAoGSGVhZGVyGAEgASgLMgwuQmxvY2tIZWFkZXISGAoE", "Qm9keRgCIAEoCzIKLkJsb2NrQm9keSJhChlTbWFydENvbnRyYWN0UmVnaXN0", "cmF0aW9uEhAKCENhdGVnb3J5GAEgASgFEhsKDENvbnRyYWN0SGFzaBgCIAEo", "CzIFLkhhc2gSFQoNQ29udHJhY3RCeXRlcxgDIAEoDCJPChdTbWFydENvbnRy", "YWN0RGVwbG95bWVudBIbCgxDb250cmFjdEhhc2gYASABKAsyBS5IYXNoEhcK", "D0NvbnN0cnVjdFBhcmFtcxgCIAEoDCJIChpTbWFydENvbnRyYWN0SW52b2tl", "Q29udGV4dBIVCgZDYWxsZXIYASABKAsyBS5IYXNoEhMKC0luY3JlbWVudElk", "GAIgASgEQg6qAgtBRWxmLktlcm5lbGIGcHJvdG8z")); >>>>>>> "Cg5tZXNzYWdlcy5wcm90byKcAQoLVHJhbnNhY3Rpb24SEwoERnJvbRgBIAEo", "CzIFLkhhc2gSEQoCVG8YAiABKAsyBS5IYXNoEhMKC0luY3JlbWVudElkGAMg", "ASgEEhIKCk1ldGhvZE5hbWUYBCABKAkSDgoGUGFyYW1zGAUgASgMEgsKA0Zl", "ZRgGIAEoBBIJCgFSGAcgASgMEgkKAVMYCCABKAwSCQoBUBgJIAEoDCIVCgRI", "YXNoEg0KBVZhbHVlGAEgASgMImkKC0Jsb2NrSGVhZGVyEg8KB1ZlcnNpb24Y", "ASABKAUSHAoNUGVydmlvdXNCbG9jaxgCIAEoCzIFLkhhc2gSKwocTWVya2xl", "VHJlZVJvb3RPZlRyYW5zYWN0aW9ucxgDIAEoCzIFLkhhc2giRAoJQmxvY2tC", "b2R5EhoKC0Jsb2NrSGVhZGVyGAEgASgLMgUuSGFzaBIbCgxUcmFuc2FjdGlv", "bnMYAiADKAsyBS5IYXNoIj8KBUJsb2NrEhwKBkhlYWRlchgBIAEoCzIMLkJs", "b2NrSGVhZGVyEhgKBEJvZHkYAiABKAsyCi5CbG9ja0JvZHkiYQoZU21hcnRD", "b250cmFjdFJlZ2lzdHJhdGlvbhIQCghDYXRlZ29yeRgBIAEoBRIbCgxDb250", "cmFjdEhhc2gYAiABKAsyBS5IYXNoEhUKDUNvbnRyYWN0Qnl0ZXMYAyABKAwi", "TwoXU21hcnRDb250cmFjdERlcGxveW1lbnQSGwoMQ29udHJhY3RIYXNoGAEg", "ASgLMgUuSGFzaBIXCg9Db25zdHJ1Y3RQYXJhbXMYAiABKAwiSAoaU21hcnRD", "b250cmFjdEludm9rZUNvbnRleHQSFQoGQ2FsbGVyGAEgASgLMgUuSGFzaBIT", "CgtJbmNyZW1lbnRJZBgCIAEoBEIOqgILQUVsZi5LZXJuZWxiBnByb3RvMw==")); <<<<<<< new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Kernel.Transaction), global::AElf.Kernel.Transaction.Parser, new[]{ "From", "To", "IncrementId", "MethodName", "Params", "Fee" }, null, null, null), ======= new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Kernel.Transaction), global::AElf.Kernel.Transaction.Parser, new[]{ "From", "To", "IncrementId", "MethodName", "Params", "R", "S", "P" }, null, null, null), >>>>>>> new pbr::GeneratedClrTypeInfo(typeof(global::AElf.Kernel.Transaction), global::AElf.Kernel.Transaction.Parser, new[]{ "From", "To", "IncrementId", "MethodName", "Params", "Fee", "R", "S", "P" }, null, null, null), <<<<<<< fee_ = other.fee_; ======= r_ = other.r_; s_ = other.s_; p_ = other.p_; >>>>>>> fee_ = other.fee_; r_ = other.r_; s_ = other.s_; p_ = other.p_; <<<<<<< /// <summary>Field number for the "Fee" field.</summary> public const int FeeFieldNumber = 6; private ulong fee_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ulong Fee { get { return fee_; } set { fee_ = value; } } ======= /// <summary>Field number for the "R" field.</summary> public const int RFieldNumber = 6; private pb::ByteString r_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString R { get { return r_; } set { r_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "S" field.</summary> public const int SFieldNumber = 7; private pb::ByteString s_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString S { get { return s_; } set { s_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "P" field.</summary> public const int PFieldNumber = 8; private pb::ByteString p_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString P { get { return p_; } set { p_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } >>>>>>> /// <summary>Field number for the "Fee" field.</summary> public const int FeeFieldNumber = 6; private ulong fee_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ulong Fee { get { return fee_; } set { fee_ = value; } } /// <summary>Field number for the "R" field.</summary> public const int RFieldNumber = 7; private pb::ByteString r_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString R { get { return r_; } set { r_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "S" field.</summary> public const int SFieldNumber = 8; private pb::ByteString s_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString S { get { return s_; } set { s_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "P" field.</summary> public const int PFieldNumber = 9; private pb::ByteString p_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString P { get { return p_; } set { p_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } <<<<<<< if (Fee != other.Fee) return false; ======= if (R != other.R) return false; if (S != other.S) return false; if (P != other.P) return false; >>>>>>> if (Fee != other.Fee) return false; if (R != other.R) return false; if (S != other.S) return false; if (P != other.P) return false; <<<<<<< if (Fee != 0UL) hash ^= Fee.GetHashCode(); ======= if (R.Length != 0) hash ^= R.GetHashCode(); if (S.Length != 0) hash ^= S.GetHashCode(); if (P.Length != 0) hash ^= P.GetHashCode(); >>>>>>> if (Fee != 0UL) hash ^= Fee.GetHashCode(); if (R.Length != 0) hash ^= R.GetHashCode(); if (S.Length != 0) hash ^= S.GetHashCode(); if (P.Length != 0) hash ^= P.GetHashCode(); <<<<<<< if (Fee != 0UL) { output.WriteRawTag(48); output.WriteUInt64(Fee); } ======= if (R.Length != 0) { output.WriteRawTag(50); output.WriteBytes(R); } if (S.Length != 0) { output.WriteRawTag(58); output.WriteBytes(S); } if (P.Length != 0) { output.WriteRawTag(66); output.WriteBytes(P); } >>>>>>> if (Fee != 0UL) { output.WriteRawTag(48); output.WriteUInt64(Fee); } if (R.Length != 0) { output.WriteRawTag(58); output.WriteBytes(R); } if (S.Length != 0) { output.WriteRawTag(66); output.WriteBytes(S); } if (P.Length != 0) { output.WriteRawTag(74); output.WriteBytes(P); } <<<<<<< if (Fee != 0UL) { size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Fee); } ======= if (R.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(R); } if (S.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(S); } if (P.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(P); } >>>>>>> if (Fee != 0UL) { size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Fee); } if (R.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(R); } if (S.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(S); } if (P.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(P); } <<<<<<< if (other.Fee != 0UL) { Fee = other.Fee; } ======= if (other.R.Length != 0) { R = other.R; } if (other.S.Length != 0) { S = other.S; } if (other.P.Length != 0) { P = other.P; } >>>>>>> if (other.Fee != 0UL) { Fee = other.Fee; } if (other.R.Length != 0) { R = other.R; } if (other.S.Length != 0) { S = other.S; } if (other.P.Length != 0) { P = other.P; } <<<<<<< case 48: { Fee = input.ReadUInt64(); break; } ======= case 50: { R = input.ReadBytes(); break; } case 58: { S = input.ReadBytes(); break; } case 66: { P = input.ReadBytes(); break; } >>>>>>> case 48: { Fee = input.ReadUInt64(); break; } case 58: { R = input.ReadBytes(); break; } case 66: { S = input.ReadBytes(); break; } case 74: { P = input.ReadBytes(); break; }
<<<<<<< using Google.Protobuf; using Google.Protobuf.WellKnownTypes; ======= using Vote; >>>>>>> using Vote; using Google.Protobuf; using Google.Protobuf.WellKnownTypes;
<<<<<<< using Acs4; ======= using AElf.Contracts.Consensus.DPoS; >>>>>>> using Acs4; using AElf.Contracts.Consensus.DPoS; <<<<<<< ======= using AElf.Kernel.Consensus.AElfConsensus.Application; >>>>>>> using AElf.Kernel.Consensus.AElfConsensus.Application;
<<<<<<< context.Services.AddSingleton<ICrossChainDataProvider, CrossChainDataProvider>(); context.Services .AddSingleton<ITransactionValidationProvider, ConstrainedCrossChainTransactionValidationProvider>(); ======= context.Services.AddTransient<ISmartContractAddressNameProvider, CrossChainSmartContractAddressNameProvider>(); context.Services.AddSingleton<ICrossChainIndexingDataService, CrossChainIndexingDataService>(); >>>>>>> context.Services.AddTransient<ISmartContractAddressNameProvider, CrossChainSmartContractAddressNameProvider>(); context.Services.AddSingleton<ICrossChainIndexingDataService, CrossChainIndexingDataService>(); context.Services .AddSingleton<ITransactionValidationProvider, ConstrainedCrossChainTransactionValidationProvider>();
<<<<<<< using Google.Protobuf; ======= using AElf.Kernel.Types; >>>>>>> using AElf.Kernel.Types; using Google.Protobuf;
<<<<<<< private readonly IBlockchainStateManager _blockchainStateManager; ======= private readonly IAccountService _accountService; private const float RatioMine = 0.3f; >>>>>>> private readonly IBlockchainStateManager _blockchainStateManager; private readonly IAccountService _accountService; private const float RatioMine = 0.3f; <<<<<<< IBlockValidationService blockValidationService, IStateManager stateManager, IBlockchainStateManager blockchainStateManager=null) ======= IBlockValidationService blockValidationService, IStateManager stateManager, TransactionFilter transactionFilter ,ConsensusDataProvider consensusDataProvider, IAccountService accountService) >>>>>>> IBlockValidationService blockValidationService, IStateManager stateManager, TransactionFilter transactionFilter ,ConsensusDataProvider consensusDataProvider, IAccountService accountService, IBlockchainStateManager blockchainStateManager=null) <<<<<<< _blockchainStateManager = blockchainStateManager; ======= _txFilter = transactionFilter; _accountService = accountService; >>>>>>> _blockchainStateManager = blockchainStateManager; _txFilter = transactionFilter; _accountService = accountService;
<<<<<<< public const int AnnouncementQueueJobTimeout = 1000; public const int TransactionQueueJobTimeout = 1000; public const int LibAnnouncementQueueJobTimeout = 1000; ======= >>>>>>> <<<<<<< public const string LibAnnouncementBroadcastQueueName = "LibAnnouncementBroadcastQueue"; ======= public const int DefaultMaxBufferedTransactionCount = 100; public const int DefaultMaxBufferedBlockCount = 50; public const int DefaultMaxBufferedAnnouncementCount = 200; >>>>>>> public const int DefaultMaxBufferedTransactionCount = 100; public const int DefaultMaxBufferedBlockCount = 50; public const int DefaultMaxBufferedAnnouncementCount = 200; public const int DefaultMaxBufferedLibAnnouncementCount = 50;
<<<<<<< private IAuthorizationInfo _authorizationInfo; ======= private IStateStore _stateStore; >>>>>>> private IAuthorizationInfo _authorizationInfo; private IStateStore _stateStore; <<<<<<< _authorizationInfo = new AuthorizationInfo(StateStore); ======= _stateStore = new StateStore(_database); >>>>>>> _authorizationInfo = new AuthorizationInfo(StateStore); _stateStore = new StateStore(_database); <<<<<<< MockBlockValidationService().Object, _chainContextService); ======= MockBlockValidationService().Object, _chainContextService, _chainManagerBasic, _stateStore); >>>>>>> MockBlockValidationService().Object, _chainContextService, _chainManagerBasic, _stateStore); <<<<<<< new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfo, _signatureVerifier, _refBlockValidator, null), _chainManagerBasic); ======= new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _signatureVerifier, _refBlockValidator), _chainManagerBasic, StateStore); >>>>>>> new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfo, _signatureVerifier, _refBlockValidator, null), _chainManagerBasic, StateStore);
<<<<<<< using AElf.Kernel.SmartContractExecution; using AElf.Kernel.SmartContractExecution.Execution; using AElf.Kernel.SmartContractExecution.Scheduling; using AElf.Kernel.Infrastructure; using AElf.Kernel.SmartContractExecution.Application; using AElf.Kernel.Tests.Concurrency.Execution; using AElf.Miner; using AElf.Miner.Rpc; ======= using AElf.Execution; using AElf.Execution.Execution; using AElf.Kernel.Storages; >>>>>>> using AElf.Kernel.SmartContractExecution; using AElf.Kernel.SmartContractExecution.Execution; using AElf.Kernel.SmartContractExecution.Scheduling; using AElf.Kernel.Infrastructure; using AElf.Kernel.SmartContractExecution.Application; using AElf.Kernel.Tests.Concurrency.Execution; using AElf.Miner; using AElf.Miner.Rpc; using AElf.Execution; using AElf.Execution.Execution; using AElf.Kernel.Storages;
<<<<<<< #region PoTC public static ulong ExpectedTransactionCount = 8000; #endregion #region Single node test public static int SingleNodeTestMiningInterval = 4000; #endregion public static ulong BasicContractZeroSerialNumber = 100; ======= public static ulong BasicContractZeroSerialNumber = 0; >>>>>>> public static ulong BasicContractZeroSerialNumber = 100;
<<<<<<< /* ======= public override void OnPreApplicationInitialization(ApplicationInitializationContext context) { var extraDataOrderInformation = context.ServiceProvider.GetService<BlockExtraDataOrderService>(); var blockExtraDataProviders = context.ServiceProvider.GetServices<IBlockExtraDataProvider>(); foreach (var blockExtraDataProvider in blockExtraDataProviders) { extraDataOrderInformation.AddExtraDataProvider(blockExtraDataProvider.GetType()); } } >>>>>>> public override void OnPreApplicationInitialization(ApplicationInitializationContext context) { var extraDataOrderInformation = context.ServiceProvider.GetService<BlockExtraDataOrderService>(); var blockExtraDataProviders = context.ServiceProvider.GetServices<IBlockExtraDataProvider>(); foreach (var blockExtraDataProvider in blockExtraDataProviders) { extraDataOrderInformation.AddExtraDataProvider(blockExtraDataProvider.GetType()); } } /*
<<<<<<< using System.Text; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Threading; ======= >>>>>>> using System.Threading; <<<<<<< public void SleepMilliseconds(int milliSeconds) { // Used to test timeout Thread.Sleep(milliSeconds); } public void NoAction() { // Don't delete, this is needed to test placeholder transactions } ======= [SmartContractFunction("${this}.Transfer", new string[]{}, new []{"${this}.Balances", "${this}.TransactionStartTimes", "${this}.TransactionEndTimes"})] >>>>>>> public void SleepMilliseconds(int milliSeconds) { // Used to test timeout Thread.Sleep(milliSeconds); } public void NoAction() { // Don't delete, this is needed to test placeholder transactions } [SmartContractFunction("${this}.Transfer", new string[]{}, new []{"${this}.Balances", "${this}.TransactionStartTimes", "${this}.TransactionEndTimes"})]
<<<<<<< // We need at least check the txs count of this block. var chainContext = await _chainContextService.GetChainContextAsync(Hash.LoadHex(ChainConfig.Instance.ChainId)); ======= // validate block before appending var chainContext = await _chainContextService.GetChainContextAsync(Hash.LoadHex(NodeConfig.Instance.ChainId)); >>>>>>> // validate block before appending var chainContext = await _chainContextService.GetChainContextAsync(Hash.LoadHex(ChainConfig.Instance.ChainId));
<<<<<<< //TODO: Add test cases for deployment permission ======= [Fact] public async Task Update_SmartContract_Without_Owner() { var contractAddress = await Deploy_SmartContracts(); var result = await AnotherTester.UpdateSmartContract.SendAsync( new ContractUpdateInput() { Address = contractAddress, Code = ByteString.CopyFrom(Codes.Single(kv => kv.Key.Contains("Consensus")).Value) }); result.TransactionResult.Status.ShouldBe(TransactionResultStatus.Failed); result.TransactionResult.Error.Contains("Only owner is allowed to update code.").ShouldBeTrue(); } >>>>>>> [Fact] public async Task Update_SmartContract_Without_Owner() { var contractAddress = await Deploy_SmartContracts(); var result = await AnotherTester.UpdateSmartContract.SendAsync( new ContractUpdateInput() { Address = contractAddress, Code = ByteString.CopyFrom(Codes.Single(kv => kv.Key.Contains("Consensus")).Value) }); result.TransactionResult.Status.ShouldBe(TransactionResultStatus.Failed); result.TransactionResult.Error.Contains("Only owner is allowed to update code.").ShouldBeTrue(); } //TODO: Add test cases for deployment permission
<<<<<<< ======= context.Services .AddSingleton<ITransactionSizeFeeUnitPriceProvider, DefaultTransactionSizeFeeUnitPriceProvider>(); context.Services.AddSingleton<ITransactionExecutingService, PlainTransactionExecutingService>(); context.Services.AddSingleton<IPlainTransactionExecutingService, PlainTransactionExecutingService>(); >>>>>>> context.Services.AddSingleton<ITransactionExecutingService, PlainTransactionExecutingService>(); context.Services.AddSingleton<IPlainTransactionExecutingService, PlainTransactionExecutingService>();
<<<<<<< using AElf.Synchronization.BlockSynchronization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.DependencyInjection; ======= >>>>>>> using AElf.Synchronization.BlockSynchronization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Volo.Abp.DependencyInjection; <<<<<<< _stateManager, _functionMetadataService)); ======= _stateManager, _functionMetadataService, _chainService), _logger); >>>>>>> _stateManager, _functionMetadataService, _chainService)); <<<<<<< byte[] code = File.ReadAllBytes(Path.GetFullPath("../../../../AElf.Contracts.CrossChain/bin/Debug/netstandard2.0/AElf.Contracts.CrossChain.dll")); return code; ======= var filePath = Path.GetFullPath("../../../../AElf.Contracts.CrossChain/bin/Debug/netstandard2.0/AElf.Contracts.CrossChain.dll"); return File.ReadAllBytes(filePath); >>>>>>> var filePath = Path.GetFullPath("../../../../AElf.Contracts.CrossChain/bin/Debug/netstandard2.0/AElf.Contracts.CrossChain.dll"); return File.ReadAllBytes(filePath); <<<<<<< new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator), _chainManager, _stateManager); ======= new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, null, _electionInfo), _chainManager, _stateManager); >>>>>>> new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, _electionInfo), _chainManager, _stateManager); <<<<<<< var hub = new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator); ======= var hub = new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, null, _electionInfo); >>>>>>> var hub = new TxHub(_transactionManager, _transactionReceiptManager, _chainService, _authorizationInfoReader, _signatureVerifier, _refBlockValidator, _electionInfo);
<<<<<<< using AElf.Standards.ACS2; ======= using Acs2; using AElf.ContractTestKit; using AElf.Kernel.Blockchain; using AElf.Kernel.Blockchain.Events; >>>>>>> using AElf.Standards.ACS2; using AElf.ContractTestKit; using AElf.Kernel.Blockchain; using AElf.Kernel.Blockchain.Events;
<<<<<<< ======= using AElf.Kernel.Blockchain.Domain; using AElf.Kernel.Blockchain.Infrastructure; >>>>>>> <<<<<<< // private async Task<bool> ValidateCrossChainLogEventInBlock(LogEvent interestedLogEvent, IBlock block) // { // foreach (var txId in block.Body.Transactions) // { // var res = await _transactionResultManager.GetTransactionResultAsync(txId); // var sideChainTransactionsRoot = // CrossChainEventHelper.TryGetValidateCrossChainBlockData(res, block, interestedLogEvent, // out var crossChainBlockData); // // first check equality with the root in header // if(sideChainTransactionsRoot == null // || !sideChainTransactionsRoot.Equals(block.Header.BlockExtraData.SideChainTransactionsRoot)) // continue; // return await ValidateCrossChainBlockDataAsync(crossChainBlockData, // block.Header.GetHash(), block.Header.Height); // } // return false; // } ======= private async Task<bool> ValidateCrossChainLogEventInBlock(LogEvent interestedLogEvent, IBlock block) { foreach (var txId in block.Body.Transactions) { var res = await _transactionResultQueryService.GetTransactionResultAsync(txId); var sideChainTransactionsRoot = CrossChainEventHelper.TryGetValidateCrossChainBlockData(res, block, interestedLogEvent, out var crossChainBlockData); // first check equality with the root in header if (sideChainTransactionsRoot == null || !sideChainTransactionsRoot.Equals(Hash.LoadByteArray(block.Header .BlockExtraDatas[ _blockExtraDataOrderService.GetExtraDataProviderOrder( typeof(CrossChainBlockExtraDataProvider))].ToByteArray()))) continue; return await ValidateCrossChainBlockDataAsync(crossChainBlockData, block.Header.GetHash(), block.Header.Height); } return false; } >>>>>>> // private async Task<bool> ValidateCrossChainLogEventInBlock(LogEvent interestedLogEvent, IBlock block) // { // foreach (var txId in block.Body.Transactions) // { // var res = await _transactionResultManager.GetTransactionResultAsync(txId); // var sideChainTransactionsRoot = // CrossChainEventHelper.TryGetValidateCrossChainBlockData(res, block, interestedLogEvent, // out var crossChainBlockData); // // first check equality with the root in header // if(sideChainTransactionsRoot == null // || !sideChainTransactionsRoot.Equals(block.Header.BlockExtraData.SideChainTransactionsRoot)) // continue; // return await ValidateCrossChainBlockDataAsync(crossChainBlockData, // block.Header.GetHash(), block.Header.Height); // } // return false; // }
<<<<<<< using AElf.Contracts.TestKit; using AElf.Kernel.Blockchain.Application; using AElf.Kernel.Consensus.Application; ======= using AElf.ContractTestKit; >>>>>>> using AElf.ContractTestKit; using AElf.Kernel.Blockchain.Application; using AElf.Kernel.Consensus.Application;
<<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", ecKeyPair, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, ecKeyPair, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, ecKeyPair, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation",null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName,null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName,null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx1 = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx1 = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx1 = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx1 = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx1 = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx1 = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, <<<<<<< var tx1 = await GenerateTransaction(CrossChainContractAddress, "RequestChainCreation", null, ======= var tx1 = GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null, >>>>>>> var tx1 = await GenerateTransaction(CrossChainContractAddress, CrossChainConsts.RequestChainCreationMethodName, null,
<<<<<<< //_logger?.Trace("Transaction insertion failed:{0}, [{1}]", res, tx.GetTransactionInfo()); //await _poolService.RemoveAsync(tx.GetHash()); ======= _logger?.Trace("Transaction insertion failed:{0}, [{1}]", res, tx.GetTransactionInfo()); // await _poolService.RemoveAsync(tx.GetHash()); >>>>>>> _logger?.Trace("Transaction insertion failed:{0}, [{1}]", res, tx.GetTransactionInfo()); // await _poolService.RemoveAsync(tx.GetHash()); <<<<<<< private Transaction GetFakeTx() { ECKeyPair keyPair = new KeyPairGenerator().Generate(); ECSigner signer = new ECSigner(); var txDep = new Transaction { From = keyPair.GetAddress(), To = GetGenesisContractHash(), IncrementId = (ulong) _currentIncr++, }; Hash hash = txDep.GetHash(); ECSignature signature = signer.Sign(keyPair, hash.GetHashBytes()); txDep.P = ByteString.CopyFrom(keyPair.PublicKey.Q.GetEncoded()); txDep.R = ByteString.CopyFrom(signature.R); txDep.S = ByteString.CopyFrom(signature.S); return txDep; } private ITransaction InvokTxDemo(ECKeyPair keyPair, Hash hash, string methodName, byte[] param, ulong index) { ECSigner signer = new ECSigner(); var txInv = new Transaction { From = keyPair.GetAddress(), To = hash, IncrementId = index, MethodName = methodName, Params = ByteString.CopyFrom(param), Fee = TxPoolConfig.Default.FeeThreshold + 1 }; Hash txhash = txInv.GetHash(); ECSignature signature = signer.Sign(keyPair, txhash.GetHashBytes()); txInv.P = ByteString.CopyFrom(keyPair.PublicKey.Q.GetEncoded()); txInv.R = ByteString.CopyFrom(signature.R); txInv.S = ByteString.CopyFrom(signature.S); var res = BroadcastTransaction(txInv).Result; return txInv; } private ITransaction DeployTxDemo(ECKeyPair keyPair) { var ContractName = "AElf.Kernel.Tests.TestContract"; var contractZeroDllPath = $"../{ContractName}/bin/Debug/netstandard2.0/{ContractName}.dll"; byte[] code = null; using (FileStream file = File.OpenRead(System.IO.Path.GetFullPath(contractZeroDllPath))) { code = file.ReadFully(); } ECSigner signer = new ECSigner(); var txDep = new Transaction { From = keyPair.GetAddress(), To = GetGenesisContractHash(), IncrementId = 0, MethodName = "DeploySmartContract", Params = ByteString.CopyFrom(ParamsPacker.Pack(0, code)), Fee = TxPoolConfig.Default.FeeThreshold + 1 }; Hash hash = txDep.GetHash(); ECSignature signature = signer.Sign(keyPair, hash.GetHashBytes()); txDep.P = ByteString.CopyFrom(keyPair.PublicKey.Q.GetEncoded()); txDep.R = ByteString.CopyFrom(signature.R); txDep.S = ByteString.CopyFrom(signature.S); var res = BroadcastTransaction(txDep).Result; return txDep; } public async Task<ulong> GetTransactionPoolSize() { return await _txPoolService.GetPoolSize(); } ======= >>>>>>>
<<<<<<< public AElfDPoSInformation DpoSInformation { get; private set; } ======= private DataProvider DataProvider { get { var dp = DataProvider.GetRootDataProvider(_chainId, _contractAddressHash); dp.StateStore = _stateStore; return dp; } } >>>>>>> public AElfDPoSInformation DpoSInformation { get; private set; } private DataProvider DataProvider { get { var dp = DataProvider.GetRootDataProvider(_chainId, _contractAddressHash); dp.StateStore = _stateStore; return dp; } }
<<<<<<< public ILocalEventBus EventBus { get; set; } ======= public IReadOnlyDictionary<long, Hash> RecentBlockHeightAndHashMappings { get; } private readonly ConcurrentDictionary<long, Hash> _recentBlockHeightAndHashMappings; >>>>>>> public ILocalEventBus EventBus { get; set; } public IReadOnlyDictionary<long, Hash> RecentBlockHeightAndHashMappings { get; } private readonly ConcurrentDictionary<long, Hash> _recentBlockHeightAndHashMappings;
<<<<<<< using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; ======= using System; using System.IO; using System.Linq; using System.Threading.Tasks; >>>>>>> using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; <<<<<<< var account = Path.CalculateAccountAddress(tx.From, tx.IncrementId).ToAccount(); ======= var account = Path.CalculateAccountAddress(tx.From, tx.IncrementId); >>>>>>> var account = Path.CalculateAccountAddress(tx.From, tx.IncrementId);
<<<<<<< public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to "); public static GUIContent enableFogText = new GUIContent("Enable Fog"); ======= public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to "); >>>>>>> public static GUIContent transparentDepthPrepassEnableText = new GUIContent("Enable transparent depth prepass", "It allow to "); public static GUIContent enableFogText = new GUIContent("Enable Fog"); <<<<<<< protected MaterialProperty enableFog = null; protected const string kEnableFog = "_EnableFog"; ======= protected MaterialProperty distortionVectorMap = null; protected const string kDistortionVectorMap = "_DistortionVectorMap"; protected MaterialProperty distortionBlendMode = null; protected const string kDistortionBlendMode = "_DistortionBlendMode"; protected MaterialProperty distortionScale = null; protected const string kDistortionScale = "_DistortionScale"; protected MaterialProperty distortionBlurScale = null; protected const string kDistortionBlurScale = "_DistortionBlurScale"; protected MaterialProperty distortionBlurRemapMin = null; protected const string kDistortionBlurRemapMin = "_DistortionBlurRemapMin"; protected MaterialProperty distortionBlurRemapMax = null; protected const string kDistortionBlurRemapMax = "_DistortionBlurRemapMax"; protected MaterialProperty preRefractionPass = null; protected const string kPreRefractionPass = "_PreRefractionPass"; >>>>>>> protected MaterialProperty distortionVectorMap = null; protected const string kDistortionVectorMap = "_DistortionVectorMap"; protected MaterialProperty distortionBlendMode = null; protected const string kDistortionBlendMode = "_DistortionBlendMode"; protected MaterialProperty distortionScale = null; protected const string kDistortionScale = "_DistortionScale"; protected MaterialProperty distortionBlurScale = null; protected const string kDistortionBlurScale = "_DistortionBlurScale"; protected MaterialProperty distortionBlurRemapMin = null; protected const string kDistortionBlurRemapMin = "_DistortionBlurRemapMin"; protected MaterialProperty distortionBlurRemapMax = null; protected const string kDistortionBlurRemapMax = "_DistortionBlurRemapMax"; protected MaterialProperty preRefractionPass = null; protected const string kPreRefractionPass = "_PreRefractionPass"; protected MaterialProperty enableFog = null; protected const string kEnableFog = "_EnableFog"; <<<<<<< enableFog = FindProperty(kEnableFog, props, false); ======= distortionVectorMap = FindProperty(kDistortionVectorMap, props, false); distortionBlendMode = FindProperty(kDistortionBlendMode, props, false); distortionScale = FindProperty(kDistortionScale, props, false); distortionBlurScale = FindProperty(kDistortionBlurScale, props, false); distortionBlurRemapMin = FindProperty(kDistortionBlurRemapMin, props, false); distortionBlurRemapMax = FindProperty(kDistortionBlurRemapMax, props, false); preRefractionPass = FindProperty(kPreRefractionPass, props, false); >>>>>>> distortionVectorMap = FindProperty(kDistortionVectorMap, props, false); distortionBlendMode = FindProperty(kDistortionBlendMode, props, false); distortionScale = FindProperty(kDistortionScale, props, false); distortionBlurScale = FindProperty(kDistortionBlurScale, props, false); distortionBlurRemapMin = FindProperty(kDistortionBlurRemapMin, props, false); distortionBlurRemapMax = FindProperty(kDistortionBlurRemapMax, props, false); preRefractionPass = FindProperty(kPreRefractionPass, props, false); enableFog = FindProperty(kEnableFog, props, false); <<<<<<< if(enableFog != null) m_MaterialEditor.ShaderProperty(enableFog, StylesBaseUnlit.enableFogText); if (distortionEnable != null) { m_MaterialEditor.ShaderProperty(distortionEnable, StylesBaseUnlit.distortionEnableText); if (distortionEnable.floatValue == 1.0f) { EditorGUI.indentLevel++; m_MaterialEditor.ShaderProperty(distortionOnly, StylesBaseUnlit.distortionOnlyText); m_MaterialEditor.ShaderProperty(distortionDepthTest, StylesBaseUnlit.distortionDepthTestText); EditorGUI.indentLevel--; } } ======= m_MaterialEditor.ShaderProperty(preRefractionPass, StylesBaseUnlit.transparentPrePassText); >>>>>>> if(enableFog != null) m_MaterialEditor.ShaderProperty(enableFog, StylesBaseUnlit.enableFogText); m_MaterialEditor.ShaderProperty(preRefractionPass, StylesBaseUnlit.transparentPrePassText);
<<<<<<< Logger.LogDebug($"Trigger sync blocks from peers, lib height: {chain.LastIrreversibleBlockHeight}, lib block hash: {blockHash}"); ======= var blockHeight = chain.LastIrreversibleBlockHeight; >>>>>>> Logger.LogDebug($"Trigger sync blocks from peers, lib height: {chain.LastIrreversibleBlockHeight}, lib block hash: {blockHash}"); var blockHeight = chain.LastIrreversibleBlockHeight; var count = NetworkOptions.Value.BlockIdRequestCount; <<<<<<< var blocks = await NetworkService.GetBlocksAsync(blockHash, count, args.SuggestedPeerPubKey); ======= var peer = peerBestChainHeight - blockHeight > InitialSyncLimit ? null : args.SuggestedPeerPubKey; var blocks = await NetworkService.GetBlocksAsync(blockHash, blockHeight, count, peer); >>>>>>> var peer = peerBestChainHeight - blockHeight > InitialSyncLimit ? null : args.SuggestedPeerPubKey; var blocks = await NetworkService.GetBlocksAsync(blockHash, blockHeight, count, peer); <<<<<<< chain = await BlockchainService.GetChainAsync(); var peerBestChainHeight = await NetworkService.GetBestChainHeightAsync(); ======= peerBestChainHeight = await NetworkService.GetBestChainHeightAsync(); >>>>>>> chain = await BlockchainService.GetChainAsync(); peerBestChainHeight = await NetworkService.GetBestChainHeightAsync();
<<<<<<< ======= private readonly ILogger _logger; private IBlockChain _blockChain; private readonly ClientManager _clientManager; >>>>>>> <<<<<<< private ECKeyPair _keyPair; ======= private readonly IChainManagerBasic _chainManagerBasic; private readonly DPoSInfoProvider _dpoSInfoProvider; >>>>>>> private ECKeyPair _keyPair; private readonly IChainManagerBasic _chainManagerBasic; private readonly DPoSInfoProvider _dpoSInfoProvider; <<<<<<< IBlockValidationService blockValidationService, IChainContextService chainContextService) ======= IBlockValidationService blockValidationService, IChainContextService chainContextService, IChainManagerBasic chainManagerBasic,IStateStore stateStore) >>>>>>> IBlockValidationService blockValidationService, IChainContextService chainContextService , IChainManagerBasic chainManagerBasic,IStateStore stateStore) <<<<<<< _keyPair = NodeConfig.Instance.ECKeyPair; _producerAddress = Address.Parse(NodeConfig.Instance.NodeAccount); _blockChain = _chainService.GetBlockChain(Config.ChainId); } /// <summary> /// Stop mining /// </summary> public void Close() { _clientManager.CloseClientsToSideChain(); _serverManager.Close(); ======= _dpoSInfoProvider = new DPoSInfoProvider(stateStore); _maxMineTime = ConsensusConfig.Instance.DPoSMiningInterval * NodeConfig.Instance.RatioMine; >>>>>>> _keyPair = NodeConfig.Instance.ECKeyPair; _producerAddress = Address.Parse(NodeConfig.Instance.NodeAccount); _blockChain = _chainService.GetBlockChain(Config.ChainId); <<<<<<< catch (ObjectDisposedException) { // Ignore if timer's callback is called after it's been disposed. // The following is paragraph from Microsoft's documentation explaining the behaviour: // https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer?redirectedfrom=MSDN&view=netcore-2.1#Remarks // // When a timer is no longer needed, use the Dispose method to free the resources // held by the timer. Note that callbacks can occur after the Dispose() method // overload has been called, because the timer queues callbacks for execution by // thread pool threads. You can use the Dispose(WaitHandle) method overload to // wait until all callbacks have completed. } })) { timer.Change(TimeoutMilliseconds, Timeout.Infinite); ======= >>>>>>> <<<<<<< : await _executingService.ExecuteAsync(txs, Config.ChainId, noTimeout ? CancellationToken.None : cts.Token, disambiguationHash, transactionType); ======= : await _executingService.ExecuteAsync(txs, Config.ChainId, cts.Token, disambiguationHash); >>>>>>> : await _executingService.ExecuteAsync(txs, Config.ChainId, cts.Token, disambiguationHash,transactionType); <<<<<<< ======= /// <summary> /// Start mining /// init clients to side chain node /// </summary> public void Init() { _keyPair = NodeConfig.Instance.ECKeyPair; _producerAddress = Address.FromRawBytes(_keyPair.GetEncodedPublicKey()); _blockChain = _chainService.GetBlockChain(Config.ChainId); } /// <summary> /// Stop mining /// </summary> public void Close() { _clientManager.CloseClientsToSideChain(); _serverManager.Close(); } >>>>>>> /// <summary> /// Stop mining /// </summary> public void Close() { _clientManager.CloseClientsToSideChain(); _serverManager.Close(); }
<<<<<<< ======= using System; using AElf.Kernel.TransactionPool.Infrastructure; using AElf.OS; >>>>>>> <<<<<<< services.AddApplication<WebAppTestAElfModule>(); ======= services.AddApplication<WebAppTestAElfModule>(options => { options.UseAutofac(); }); services.AddSingleton<ITxHub, MockTxHub>(); return services.BuildAutofacServiceProvider(); >>>>>>> services.AddSingleton<ITxHub, MockTxHub>(); services.AddApplication<WebAppTestAElfModule>();
<<<<<<< if (block.Height != Constants.GenesisBlockHeight && block.Header.Time.ToDateTime() - DateTime.UtcNow > KernelConsts.AllowedFutureBlockTimeSpan) ======= if (block.Height != KernelConstants.GenesisBlockHeight && block.Header.Time.ToDateTime() - DateTime.UtcNow > KernelConstants.AllowedFutureBlockTimeSpan) >>>>>>> if (block.Height != Constants.GenesisBlockHeight && block.Header.Time.ToDateTime() - DateTime.UtcNow > KernelConstants.AllowedFutureBlockTimeSpan)
<<<<<<< new SmartContractService(SmartContractManager, _smartContractRunnerContainer, stateStore, functionMetadataService, _chainService); ======= new SmartContractService(SmartContractManager, _smartContractRunnerContainer, _stateManager, functionMetadataService); >>>>>>> new SmartContractService(SmartContractManager, _smartContractRunnerContainer, _stateManager, functionMetadataService, _chainService); <<<<<<< await trace.SmartCommitChangesAsync(_stateStore); ======= await trace.CommitChangesAsync(_stateManager); >>>>>>> await trace.SmartCommitChangesAsync(_stateManager);
<<<<<<< ======= >>>>>>>
<<<<<<< ======= using AElf.Contracts.TestKit; using AElf.Kernel; >>>>>>> using AElf.Contracts.TestKit; <<<<<<< SchemeId = schemeId, BeneficiaryShare = new BeneficiaryShare {Beneficiary = Address.Generate(), Shares = shares} ======= ProfitId = profitId, Receiver = SampleAddress.AddressList[0], Weight = weight >>>>>>> SchemeId = schemeId, BeneficiaryShare = new BeneficiaryShare {Beneficiary = SampleAddress.AddressList[0], Shares = shares} <<<<<<< const int shares1 = 100; const int shares2 = 200; var receiver1 = Address.Generate(); var receiver2 = Address.Generate(); ======= const int weight1 = 100; const int weight2 = 200; var receiver1 = SampleAddress.AddressList[0]; var receiver2 = SampleAddress.AddressList[1]; >>>>>>> const int shares1 = 100; const int shares2 = 200; var receiver1 = SampleAddress.AddressList[0]; var receiver2 = SampleAddress.AddressList[1]; <<<<<<< var beneficiary = Address.Generate(); ======= var receiver = SampleAddress.AddressList[0]; >>>>>>> var beneficiary = SampleAddress.AddressList[0]; <<<<<<< SchemeId = Hash.FromString("SchemeId"), BeneficiaryShare = new BeneficiaryShare {Beneficiary = Address.Generate(), Shares = 100}, ======= ProfitId = Hash.FromString("hash"), Receiver = SampleAddress.AddressList[0], Weight = 100 >>>>>>> SchemeId = Hash.FromString("SchemeId"), BeneficiaryShare = new BeneficiaryShare {Beneficiary = SampleAddress.AddressList[0], Shares = 100}, <<<<<<< SchemeId = Hash.FromString("SchemeId"), Beneficiary = Address.Generate() ======= ProfitId = Hash.FromString("hash2"), Receiver = SampleAddress.AddressList[0] >>>>>>> SchemeId = Hash.FromString("SchemeId"), Beneficiary = SampleAddress.AddressList[0] <<<<<<< BeneficiaryShare = new BeneficiaryShare {Beneficiary = Address.Generate(), Shares = 100}, SchemeId = schemeId, ======= Receiver = SampleAddress.AddressList[0], ProfitId = profitId, Weight = 100 >>>>>>> BeneficiaryShare = new BeneficiaryShare {Beneficiary = SampleAddress.AddressList[0], Shares = 100}, SchemeId = schemeId, <<<<<<< BeneficiaryShare = new BeneficiaryShare {Beneficiary = Address.Generate(), Shares = 100}, SchemeId = schemeId, ======= Receiver = SampleAddress.AddressList[0], ProfitId = profitId, Weight = 100 >>>>>>> BeneficiaryShare = new BeneficiaryShare {Beneficiary = SampleAddress.AddressList[0], Shares = 100}, SchemeId = schemeId, <<<<<<< BeneficiaryShare = new BeneficiaryShare {Beneficiary = Address.Generate(), Shares = 100}, SchemeId = schemeId, ======= Receiver = SampleAddress.AddressList[0], ProfitId = profitId, Weight = 100 >>>>>>> BeneficiaryShare = new BeneficiaryShare {Beneficiary = SampleAddress.AddressList[0], Shares = 100}, SchemeId = schemeId,