Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jopmiddelkamp committed Aug 10, 2024
1 parent 08be7cd commit e8f6198
Show file tree
Hide file tree
Showing 375 changed files with 2,421 additions and 1,106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pack_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: GitHub Ref
run: |
run: |
echo "GitHub Ref: ${{github.ref}}"
- name: GitHub Head Ref
run: |
Expand Down
3 changes: 1 addition & 2 deletions StellarDotnetSdk.Console/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using StellarDotnetSdk.Accounts;
using StellarDotnetSdk.Operations;
using StellarDotnetSdk.Transactions;
Expand Down
12 changes: 9 additions & 3 deletions StellarDotnetSdk.Tests/Accounts/KeyPairTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void TestFromSecretSeed()
{
"SDYZ5IYOML3LTWJ6WIAC2YWORKVO7GJRTPPGGNJQERH72I6ZCQHDAJZN",
"GABXJTV7ELEB2TQZKJYEGXBUIG6QODJULKJDI65KZMIZZG2EACJU5EA7"
}
},
};

foreach (var (key, accountId) in keypairs)
Expand Down Expand Up @@ -163,7 +163,10 @@ public void TestSignPayloadSigner()
var sig = keypair.SignPayloadDecorated(payload);
var bytes = new byte[] { 0xFF & 252, 65, 0, 50 };

for (var i = 0; i < sig.Hint.InnerValue.Length; i++) sig.Hint.InnerValue[i] = bytes[i];
for (var i = 0; i < sig.Hint.InnerValue.Length; i++)
{
sig.Hint.InnerValue[i] = bytes[i];
}
}


Expand All @@ -177,6 +180,9 @@ public void TestSignPayloadSignerLessThanHint()
var sig = keypair.SignPayloadDecorated(payload);
var bytes = new byte[] { 255, 64, 7, 55 };

for (var i = 0; i < sig.Hint.InnerValue.Length; i++) sig.Hint.InnerValue[i] = bytes[i];
for (var i = 0; i < sig.Hint.InnerValue.Length; i++)
{
sig.Hint.InnerValue[i] = bytes[i];
}
}
}
6 changes: 3 additions & 3 deletions StellarDotnetSdk.Tests/Assets/TrustlineAssetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void TestFromXdrAlphaNum4()
var trustlineAssetNativeXdr = new XDR.TrustLineAsset
{
Discriminant = new XDR.AssetType { InnerValue = XDR.AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4 },
AlphaNum4 = Asset.Create($"USD:{keypair.AccountId}").ToXdr().AlphaNum4
AlphaNum4 = Asset.Create($"USD:{keypair.AccountId}").ToXdr().AlphaNum4,
};

var trustlineAsset = (TrustlineAsset.Wrapper)TrustlineAsset.FromXdr(trustlineAssetNativeXdr);
Expand All @@ -102,7 +102,7 @@ public void TestFromXdrAlphaNum12()
var trustlineAssetNativeXdr = new XDR.TrustLineAsset
{
Discriminant = XDR.AssetType.Create(XDR.AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12),
AlphaNum12 = Asset.Create($"USDUSD:{keypair.AccountId}").ToXdr().AlphaNum12
AlphaNum12 = Asset.Create($"USDUSD:{keypair.AccountId}").ToXdr().AlphaNum12,
};

var trustlineAsset = (TrustlineAsset.Wrapper)TrustlineAsset.FromXdr(trustlineAssetNativeXdr);
Expand All @@ -114,7 +114,7 @@ public void TestFromXdrNative()
{
var trustlineAssetNativeXdr = new XDR.TrustLineAsset
{
Discriminant = XDR.AssetType.Create(XDR.AssetType.AssetTypeEnum.ASSET_TYPE_NATIVE)
Discriminant = XDR.AssetType.Create(XDR.AssetType.AssetTypeEnum.ASSET_TYPE_NATIVE),
};

var trustlineAsset = (TrustlineAsset.Wrapper)TrustlineAsset.FromXdr(trustlineAssetNativeXdr);
Expand Down
12 changes: 6 additions & 6 deletions StellarDotnetSdk.Tests/BalanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Constructor_LiquidityPool(bool expectedIsAuthorized, bool expectedIs
BalanceString = expectedBalance,
IsAuthorized = expectedIsAuthorized,
IsAuthorizedToMaintainLiabilities = expectedIsAuthorizedToMaintainLiabilities,
LiquidityPoolId = expectedLiquidityPoolId
LiquidityPoolId = expectedLiquidityPoolId,
};

// expected
Expand Down Expand Up @@ -92,7 +92,7 @@ public void Constructor_CreditAlphaNum(
BuyingLiabilities = expectedBuyingLiabilities,
SellingLiabilities = expectedSellingLiabilities,
IsAuthorized = expectedIsAuthorized,
IsAuthorizedToMaintainLiabilities = expectedIsAuthorizedToMaintainLiabilities
IsAuthorizedToMaintainLiabilities = expectedIsAuthorizedToMaintainLiabilities,
};

// expected
Expand Down Expand Up @@ -132,7 +132,7 @@ public Property Asset_AlphaNum4(string assetCode)
BuyingLiabilities = A.Dummy<string>(),
SellingLiabilities = A.Dummy<string>(),
IsAuthorized = A.Dummy<bool>(),
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>()
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>(),
};

return (Sut.Asset is AssetTypeCreditAlphaNum4).ToProperty();
Expand All @@ -151,7 +151,7 @@ public Property Asset_AlphaNum12(string assetCode)
BuyingLiabilities = A.Dummy<string>(),
SellingLiabilities = A.Dummy<string>(),
IsAuthorized = A.Dummy<bool>(),
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>()
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>(),
};

return (Sut.Asset is AssetTypeCreditAlphaNum12).ToProperty();
Expand All @@ -170,7 +170,7 @@ public void Asset_Native()
BuyingLiabilities = A.Dummy<string>(),
SellingLiabilities = A.Dummy<string>(),
IsAuthorized = A.Dummy<bool>(),
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>()
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>(),
};

// actual
Expand All @@ -196,7 +196,7 @@ public void Asset_LiquidityPool()
SellingLiabilities = A.Dummy<string>(),
IsAuthorized = A.Dummy<bool>(),
IsAuthorizedToMaintainLiabilities = A.Dummy<bool>(),
LiquidityPoolId = expectedLiquidityPoolId
LiquidityPoolId = expectedLiquidityPoolId,
};

// actual
Expand Down
4 changes: 2 additions & 2 deletions StellarDotnetSdk.Tests/ClaimLiquidityAtomTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public void TestFromXdr()
{
Discriminant = new ClaimAtomType
{
InnerValue = ClaimAtomType.ClaimAtomTypeEnum.CLAIM_ATOM_TYPE_LIQUIDITY_POOL
InnerValue = ClaimAtomType.ClaimAtomTypeEnum.CLAIM_ATOM_TYPE_LIQUIDITY_POOL,
},
LiquidityPool = claimLiquidityAtomXdr
LiquidityPool = claimLiquidityAtomXdr,
};

var claimAtomLiquidityPool = (ClaimAtomLiquidityPool)ClaimAtom.FromXdr(claimAtom);
Expand Down
4 changes: 2 additions & 2 deletions StellarDotnetSdk.Tests/Federation/FederationServerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task TestCreateForDomain()
fakeHttpMessageHandler.Setup(a => a.Send(It.IsAny<HttpRequestMessage>())).Returns(new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK,
Content = new StringContent(StellarToml)
Content = new StringContent(StellarToml),
});

using (var server = await FederationServer.CreateForDomain("stellar.org"))
Expand Down Expand Up @@ -79,7 +79,7 @@ private static FederationServer CreateTestServer(string content, HttpStatusCode
var httpResponseMessage = new HttpResponseMessage
{
StatusCode = statusCode,
Content = new StringContent(content)
Content = new StringContent(content),
};

httpResponseMessage.Headers.Add("X-Ratelimit-Limit", "-1");
Expand Down
4 changes: 2 additions & 2 deletions StellarDotnetSdk.Tests/Federation/FederationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public async Task TestResolveSuccess()
.Returns(new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK,
Content = new StringContent("FEDERATION_SERVER = \"https://api.stellar.org/federation\"")
Content = new StringContent("FEDERATION_SERVER = \"https://api.stellar.org/federation\""),
})
.Returns(new HttpResponseMessage
{
StatusCode = HttpStatusCode.OK,
Content = new StringContent(
"{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\"}")
"{\"stellar_address\":\"bob*stellar.org\",\"account_id\":\"GCW667JUHCOP5Y7KY6KGDHNPHFM4CS3FCBQ7QWDUALXTX3PGXLSOEALY\"}"),
});

var response = await StellarDotnetSdk.Federation.Federation.Resolve("bob*stellar.org");
Expand Down
Loading

0 comments on commit e8f6198

Please sign in to comment.