Skip to content

Commit 0b023eb

Browse files
committed
code cleanup
1 parent 51924a8 commit 0b023eb

File tree

15 files changed

+24
-30
lines changed

15 files changed

+24
-30
lines changed

csharp/IotaWalletNet/IotaWalletNet.Application/Account.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
using IotaWalletNet.Domain.Common.Models.Nft;
3838
using IotaWalletNet.Domain.Common.Models.Output;
3939
using IotaWalletNet.Domain.Common.Models.Output.OutputDataTypes;
40-
using IotaWalletNet.Domain.Common.Models.Transaction;
4140
using IotaWalletNet.Domain.Common.Models.Transaction.PayloadTypes;
4241
using IotaWalletNet.Domain.PlatformInvoke;
4342
using MediatR;
@@ -60,7 +59,7 @@ public Account(IMediator mediator, string username, IWallet wallet)
6059
public IWallet Wallet { get; }
6160

6261

63-
public async Task<SendOutputsResponse> SendOutputsAsync(List<IOutputType> outputs, TaggedDataPayload? taggedDataPayload=null)
62+
public async Task<SendOutputsResponse> SendOutputsAsync(List<IOutputType> outputs, TaggedDataPayload? taggedDataPayload = null)
6463
{
6564
return await _mediator.Send(new SendOutputsCommand(this, Username, outputs, taggedDataPayload));
6665
}

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Commands/BuildBasicOutput/BuildBasicOutputCommandMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace IotaWalletNet.Application.AccountContext.Commands.BuildBasicOutput
66
public class BuildBasicOutputCommandMessage : AccountMessage<BuildBasicOutputData>
77
{
88
private const string METHOD_NAME = "buildBasicOutput";
9-
public BuildBasicOutputCommandMessage(string username, BuildBasicOutputData? methodData)
9+
public BuildBasicOutputCommandMessage(string username, BuildBasicOutputData? methodData)
1010
: base(username, METHOD_NAME, methodData)
1111
{
1212
}

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Commands/EnablePeriodicSyncing/EnablePeriodicSyncingCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public EnablePeriodicSyncingCommand(IAccount account, int intervalInMilliSeconds
1313

1414
public IAccount Account { get; set; }
1515

16-
public int IntervalInMilliSeconds { get;set; }
17-
16+
public int IntervalInMilliSeconds { get; set; }
17+
1818
}
1919
}

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Commands/SendOutputs/SendOutputsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace IotaWalletNet.Application.AccountContext.Commands.SendOutputs
77
{
88
public class SendOutputsCommand : IRequest<SendOutputsResponse>
99
{
10-
public SendOutputsCommand(IAccount account, string username, List<IOutputType> outputs, TaggedDataPayload? taggedDataPayload=null)
10+
public SendOutputsCommand(IAccount account, string username, List<IOutputType> outputs, TaggedDataPayload? taggedDataPayload = null)
1111
{
1212
Account = account;
1313
Username = username;
@@ -18,9 +18,9 @@ public SendOutputsCommand(IAccount account, string username, List<IOutputType> o
1818
public IAccount Account { get; set; }
1919

2020
public string Username { get; set; }
21-
21+
2222
public List<IOutputType> Outputs { get; set; }
23-
23+
2424
public TaggedDataPayload? TaggedDataPayload { get; set; }
2525

2626
}

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Commands/SendOutputs/SendOutputsCommandHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ public class SendOutputsCommandHandler : IRequestHandler<SendOutputsCommand, Sen
1010
public async Task<SendOutputsResponse> Handle(SendOutputsCommand request, CancellationToken cancellationToken)
1111
{
1212
TransactionOptions transactionOptions = new TransactionOptions() { TaggedDataPayload = request.TaggedDataPayload };
13-
13+
1414
SendOutputsCommandMessageData messageData = new SendOutputsCommandMessageData(request.Outputs, transactionOptions);
15-
15+
1616
SendOutputsCommandMessage message = new SendOutputsCommandMessage(request.Username, messageData);
1717

1818
string messageJson = JsonConvert.SerializeObject(message);
1919

2020
RustBridgeGenericResponse rustBridgeGenericResponse = await request.Account.SendMessageAsync(messageJson);
21-
21+
2222
SendOutputsResponse sendOutputsResponse = rustBridgeGenericResponse.As<SendOutputsResponse>()!;
2323

2424
return sendOutputsResponse;

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Commands/SendOutputs/SendOutputsCommandMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace IotaWalletNet.Application.AccountContext.Commands.SendOutputs
55
public class SendOutputsCommandMessage : AccountMessage<SendOutputsCommandMessageData>
66
{
77
private const string METHOD_NAME = "sendOutputs";
8-
public SendOutputsCommandMessage(string username, SendOutputsCommandMessageData? methodData)
8+
public SendOutputsCommandMessage(string username, SendOutputsCommandMessageData? methodData)
99
: base(username, METHOD_NAME, methodData)
1010
{
1111
}

csharp/IotaWalletNet/IotaWalletNet.Application/AccountContext/Queries/GetOutputsWithAdditionalUnlockConditions/GetOutputsWithAdditionalUnlockConditionsMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class GetOutputsWithAdditionalUnlockConditionsMessage : AccountMessage<Ge
66
{
77
private const string METHOD_NAME = "getOutputsWithAdditionalUnlockConditions";
88

9-
public GetOutputsWithAdditionalUnlockConditionsMessage(string username, GetOutputsWithAdditionalUnlockConditionsMessageData? methodData)
9+
public GetOutputsWithAdditionalUnlockConditionsMessage(string username, GetOutputsWithAdditionalUnlockConditionsMessageData? methodData)
1010
: base(username, METHOD_NAME, methodData)
1111
{
1212
}

csharp/IotaWalletNet/IotaWalletNet.Domain/Common/Extensions/NumberExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static string PreprocessHexEncodedAmountString(string hexEncodedAmount)
2626
if (hexEncodedAmount.ToLower().StartsWith("0x"))
2727
hexEncodedAmount = hexEncodedAmount.Substring(2);
2828

29-
if(hexEncodedAmount.Length % 2 != 0)
29+
if (hexEncodedAmount.Length % 2 != 0)
3030
hexEncodedAmount = "0" + hexEncodedAmount;
3131

3232
return hexEncodedAmount;

csharp/IotaWalletNet/IotaWalletNet.Domain/Common/Extensions/StringExtensions.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using IotaWalletNet.Domain.Common.Models.Address;
44
using IotaWalletNet.Domain.Common.Models.Coin;
55
using IotaWalletNet.Domain.Common.Models.Network;
6-
using System.Buffers.Text;
76
using System.Text;
87

98
namespace IotaWalletNet.Domain.Common.Extensions
@@ -14,13 +13,13 @@ public static class StringExtensions
1413

1514
public static bool IsNotNullAndEmpty(this string? input) => !input.IsNullOrEmpty();
1615

17-
public static string ToHexString(this string input)
16+
public static string ToHexString(this string input)
1817
=> "0x" + Convert.ToHexString(Encoding.UTF8.GetBytes(input));
19-
18+
2019

2120
public static string FromHexString(this string hexString)
2221
{
23-
if(hexString.ToLower().StartsWith("0x"))
22+
if (hexString.ToLower().StartsWith("0x"))
2423
hexString = hexString.Substring(2); // remove the 0x of a hexstring eg 0x1337
2524

2625
// eg 0x0 becomes 0 then becomes 00, to be able to use fromhexstring, we need length of hexstring to be % 2
@@ -47,7 +46,7 @@ public static string ComputeBlake2bHash(this string hexEncoded)
4746

4847
return "0x" + Convert.ToHexString(hash);
4948
}
50-
49+
5150
public static string EncodeEd25519HashIntoBech32(this string blake2bHashOfEd25519, NetworkType networkType, TypeOfCoin typeOfCoin)
5251
{
5352
blake2bHashOfEd25519 = blake2bHashOfEd25519.Trim().ToLower();
@@ -74,7 +73,7 @@ public static string DecodeBech32IntoEd25519Hash(this string bech32, NetworkType
7473
string bech32OfInterest = bech32.Substring(4); //eg remove iota1 or smr1 or atoi1 or rms1
7574

7675
byte[] decoded = Bech32Engine.Decode(bech32OfInterest, hrp);
77-
76+
7877
return "0x" + Convert.ToHexString(decoded);
7978
}
8079
}

csharp/IotaWalletNet/IotaWalletNet.Domain/Common/Models/Output/OutputDataTypes/BuildBasicOutputData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public BuildBasicOutputData(string? amount, NativeToken? nativeTokens, List<IUnl
2020

2121
public NativeToken? NativeTokens { get; set; }
2222

23-
public List<IUnlockConditionType> UnlockConditions{ get; set; }
23+
public List<IUnlockConditionType> UnlockConditions { get; set; }
2424

2525
public List<IFeatureType>? Features { get; set; }
2626
}

0 commit comments

Comments
 (0)