Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nameof instead of magic strings (GUI, Packager, Tests projects) #2145

Merged
merged 2 commits into from Aug 23, 2019

Conversation

@yahiheb
Copy link
Collaborator

commented Aug 22, 2019

No description provided.

WalletWasabi.Gui/Global.cs Outdated Show resolved Hide resolved
@lontivero
Copy link
Collaborator

left a comment

Looks good. Please review my and @benthecarman's comments.

@lontivero lontivero merged commit 3958d9a into zkSNACKs:master Aug 23, 2019

4 checks passed

CodeFactor No issues found.
Details
Wasabi.Linux #20190822.8 succeeded
Details
Wasabi.Osx #20190822.8 succeeded
Details
Wasabi.Windows #20190822.8 succeeded
Details

#endregion ConfigInitialization

BitcoinStore = new BitcoinStore();
var bstoreInitTask = BitcoinStore.InitializeAsync(Path.Combine(DataDir, "BitcoinStore"), Network);
var bstoreInitTask = BitcoinStore.InitializeAsync(Path.Combine(DataDir, $"{nameof(BitcoinStore)}"), Network);

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Don't nameof filepath.

var hwiInitTask = HwiProcessManager.InitializeAsync(DataDir, Network);
var addressManagerFolderPath = Path.Combine(DataDir, "AddressManager");
AddressManagerFilePath = Path.Combine(addressManagerFolderPath, $"AddressManager{Network}.dat");
var addressManagerFolderPath = Path.Combine(DataDir, $"{nameof(AddressManager)}");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Don't nameof filepath.

var addressManagerFolderPath = Path.Combine(DataDir, "AddressManager");
AddressManagerFilePath = Path.Combine(addressManagerFolderPath, $"AddressManager{Network}.dat");
var addressManagerFolderPath = Path.Combine(DataDir, $"{nameof(AddressManager)}");
AddressManagerFilePath = Path.Combine(addressManagerFolderPath, $"{nameof(AddressManager)}{Network}.dat");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Don't nameof filepath.

@@ -308,7 +308,7 @@ private async Task<AddressManagerBehavior> InitializeAddressManagerBehaviorAsync
if (Network == Network.RegTest)
{
AddressManager = new AddressManager();
Logger.LogInfo<AddressManager>($"Fake {nameof(AddressManager)} is initialized on the RegTest.");
Logger.LogInfo<AddressManager>($"Fake {nameof(AddressManager)} is initialized on the {nameof(Network.RegTest)}.");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

No need for nameofing here.

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Network.ToString does the job.

@@ -50,8 +50,8 @@ public async Task TestServicesAsync(string networkString)
throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
}

var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, "AddressManager");
var addressManagerFilePath = Path.Combine(addressManagerFolderPath, $"AddressManager{network}.dat");
var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, $"{nameof(AddressManager)}");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Don't nameof filepath.

var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, "AddressManager");
var addressManagerFilePath = Path.Combine(addressManagerFolderPath, $"AddressManager{network}.dat");
var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, $"{nameof(AddressManager)}");
var addressManagerFilePath = Path.Combine(addressManagerFolderPath, $"{nameof(AddressManager)}{network}.dat");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

Don't nameof filepath.

@@ -1192,7 +1192,7 @@ public async Task SendTransactionAsync(SmartTransaction transaction)

if (Network == Network.RegTest)
{
throw new InvalidOperationException("Transaction broadcasting to nodes does not work in RegTest.");
throw new InvalidOperationException($"Transaction broadcasting to nodes does not work in {nameof(Network.RegTest)}.");

This comment has been minimized.

Copy link
@nopara73

nopara73 Aug 23, 2019

Collaborator

No need for nameof here.

nopara73 added a commit to nopara73/WalletWasabi that referenced this pull request Aug 23, 2019
@nopara73

This comment has been minimized.

Copy link
Collaborator

commented Aug 23, 2019

Reverted the incorrect nameofs: 7604073

@yahiheb yahiheb deleted the yahiheb:nameof-gui-packager-tests branch Aug 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.