Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/nesting-error-scrollview
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarwal4 authored Nov 8, 2023
2 parents adb05ad + d87933d commit 476cd7b
Show file tree
Hide file tree
Showing 20 changed files with 3,735 additions and 3,777 deletions.
4 changes: 2 additions & 2 deletions backend/core/src/Core.API/Core.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Nexus.SDK.Shared" Version="2023.2.27.17" />
<PackageReference Include="Nexus.Token.SDK" Version="2023.2.27.17" />
<PackageReference Include="Quantoz.Nexus.Sdk.Shared" Version="1.0.1" />
<PackageReference Include="Quantoz.Nexus.Sdk.Token" Version="1.0.1" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.6.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.6.0" />
<PackageReference Include="ReHackt.Extensions.Options.Validation" Version="7.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
using Core.Infrastructure.Nexus.Repositories;
using Core.Infrastructure.Nexus.SigningService;
using Microsoft.Extensions.Options;
using Nexus.SDK.Shared.Http;
using Nexus.Token.SDK.Extensions;
using Nexus.Sdk.Shared.Http;
using Nexus.Sdk.Token.Extensions;
using Quartz;

namespace Core.API.DependencyInjection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

using Core.Domain.Exceptions;
using Core.Presentation.Models;
using Microsoft.EntityFrameworkCore;
using Nexus.SDK.Shared.ErrorHandling;
using Nexus.Sdk.Shared.ErrorHandling;
using System.Text.Json;

namespace Core.API.ResponseHandling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.1" />
<PackageReference Include="Otp.NET" Version="1.3.0" />
<PackageReference Include="Quantoz.Nexus.Sdk.Token" Version="1.0.1" />
<PackageReference Include="Quartz" Version="3.6.0" />
<PackageReference Include="Nexus.Token.SDK" Version="2023.2.27.17" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Core.Domain.Exceptions;
using Core.Domain.Repositories;
using Core.Infrastructure.Nexus.SigningService;
using Nexus.Token.SDK;
using Nexus.Sdk.Token;

namespace Core.Infrastructure.Nexus.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using Core.Domain.Entities.CustomerAggregate;
using Core.Domain.Exceptions;
using Core.Domain.Repositories;
using Nexus.SDK.Shared.Requests;
using Nexus.Token.SDK;
using Nexus.Token.SDK.Responses;
using Nexus.Sdk.Shared.Requests;
using Nexus.Sdk.Token;
using Nexus.Sdk.Token.Responses;

namespace Core.Infrastructure.Nexus.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Core.Domain.Entities.SettingsAggregate;
using Core.Domain.Exceptions;
using Core.Domain.Repositories;
using Nexus.Token.SDK;
using Nexus.Sdk.Token;

namespace Core.Infrastructure.Nexus.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using Core.Domain.Primitives;
using Core.Domain.Repositories;
using Core.Infrastructure.Nexus.SigningService;
using Nexus.Token.SDK;
using Nexus.Token.SDK.Responses;
using Nexus.Sdk.Token;
using Nexus.Sdk.Token.Responses;

namespace Core.Infrastructure.Nexus.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,61 @@
// under the Apache License, Version 2.0. See the NOTICE file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

using Nexus.Token.SDK.Requests;
using Nexus.Token.SDK.Responses;
using Nexus.Sdk.Token.Requests;
using Nexus.Sdk.Token.Responses;

namespace Core.Infrastructure.Nexus.SigningService
{
public static class ISigningServiceExtensions
{
public static async Task<AlgorandSubmitRequest[]> SignAlgorandTransactionAsync(this ISigningService signingService, string publicKey, SignableResponse signableResponse)
public static Task<AlgorandSubmitSignatureRequest[]> SignAlgorandTransactionAsync(this ISigningService signingService, string publicKey, SignableResponse signableResponse)
{
var algorandTransactions = signableResponse.BlockchainResponse.AlgorandTransactions;

if (algorandTransactions == null || !algorandTransactions.Any())
if (signableResponse.BlockchainResponse.RequiredSignatures == null)
{
throw new InvalidOperationException("No Algorand transactions to sign");
}

var algorandTransaction = algorandTransactions.First();
var encodedTransaction = algorandTransaction.EncodedTransaction;
var unsignedTransactions = signableResponse.BlockchainResponse.RequiredSignatures
.Where(r => r.PublicKey == publicKey)
.ToList();

var submitRequests = unsignedTransactions.Select(async unsignedTransaction =>
{
var encodedUnsignedTransaction = unsignedTransaction.EncodedTransaction;
var hash = unsignedTransaction.Hash;

var request = new SignRequest(Blockchain.ALGORAND, publicKey, encodedTransaction);
var signedTransaction = await signingService.Sign(request);
var signRequest = new SignRequest(Blockchain.ALGORAND, publicKey, encodedUnsignedTransaction);
var encodedSignedTransaction = await signingService.Sign(signRequest);

var submitRequest = new AlgorandSubmitRequest(algorandTransaction.Hash, publicKey, signedTransaction);
return new AlgorandSubmitRequest[] { submitRequest };
return new AlgorandSubmitSignatureRequest(hash, publicKey, encodedSignedTransaction);
});

return Task.FromResult(submitRequests.Select(t => t.Result).ToArray());
}

public static async Task<StellarSubmitRequest> SignStellarTransactionEnvelopeAsync(this ISigningService signingService, string publicKey, SignableResponse signableResponse)
public static Task<StellarSubmitSignatureRequest[]> SignStellarTransactionEnvelopeAsync(this ISigningService signingService, string publicKey, SignableResponse signableResponse)
{
var encodedStellarEnvelope = signableResponse.BlockchainResponse.EncodedStellarEnvelope;

if (encodedStellarEnvelope == null)
if (signableResponse.BlockchainResponse.RequiredSignatures == null)
{
throw new InvalidOperationException("No Stellar transaction envelopes to sign");
throw new InvalidOperationException("No Stellar transactions to sign");
}

var request = new SignRequest(Blockchain.STELLAR, publicKey, encodedStellarEnvelope);
var signedTransactionEnvelope = await signingService.Sign(request);
var unsignedTransactions = signableResponse.BlockchainResponse.RequiredSignatures
.Where(r => r.PublicKey == publicKey)
.ToList();

var submitRequests = unsignedTransactions.Select(async unsignedTransaction =>
{
var encodedUnsignedTransaction = unsignedTransaction.EncodedTransaction;
var hash = unsignedTransaction.Hash;

var signRequest = new SignRequest(Blockchain.STELLAR, publicKey, encodedUnsignedTransaction);
var encodedSignedTransaction = await signingService.Sign(signRequest);

return new StellarSubmitSignatureRequest(hash, publicKey, encodedSignedTransaction);
});

return new StellarSubmitRequest(signedTransactionEnvelope);
return Task.FromResult(submitRequests.Select(t => t.Result).ToArray());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// under the Apache License, Version 2.0. See the NOTICE file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0

using Nexus.SDK.Shared.Requests;
using Nexus.SDK.Shared.Responses;
using Nexus.Token.SDK.Responses;
using Nexus.Sdk.Shared.Requests;
using Nexus.Sdk.Shared.Responses;
using Nexus.Sdk.Token.Responses;

namespace Core.InfrastructureTests.Helpers
{
Expand Down Expand Up @@ -43,7 +43,16 @@ public static AccountResponse AccountResponse(string customerCode)

public static SignableResponse SignableResponse()
{
var response = new BlockchainResponse("TestHash", "EncodedEnvelope", Array.Empty<AlgorandTransactionResponse>());
var response = new BlockchainResponse(
"TestHash",
"EncodedEnvelope",
new RequiredSignaturesResponse[]
{
new RequiredSignaturesResponse("c1cdb46f894dfc80e50efeb27727517f3227303e4ef9ea83d2f1b3b250a91317",
"AAAAAgAAAACN5Y0YBD6bCPzSRzpJt6ZbEkQEKJXzaiE1h8ayIbnOjgBMS0AAAUhyAAAAGwAAAAAAAAAAAAAABQAAAAEAAAAAjeWNGAQ+mwj80kc6SbemWxJEBCiV82ohNYfGsiG5zo4AAAAAAAAAABvC06B170rV0q+i7svuTL0JdIVfuMt0eSWe7OXQgSkwAAAAAAExLQAAAAABAAAAABvC06B170rV0q+i7svuTL0JdIVfuMt0eSWe7OXQgSkwAAAABgAAAAI5OGMxYzc1NgAAAAAAAAAAcjHJmVw1cnxWiB+Ip6yft9txmoVd160+Bx221MHSqSd//////////wAAAAEAAAAAcjHJmVw1cnxWiB+Ip6yft9txmoVd160+Bx221MHSqScAAAAVAAAAABvC06B170rV0q+i7svuTL0JdIVfuMt0eSWe7OXQgSkwAAAAAjk4YzFjNzU2AAAAAAAAAAByMcmZXDVyfFaIH4inrJ+323GahV3XrT4HHbbUwdKpJwAAAAAAAAABAAAAAQAAAAAbwtOgde9K1dKvou7L7ky9CXSFX7jLdHklnuzl0IEpMAAAAAYAAAACNmMzN2E2MTUAAAAAAAAAAHW+Oaaa8Gw0gaFzg6bpf24PMDQCippaxMGLaHB0Wq5pf/////////8AAAABAAAAAHW+Oaaa8Gw0gaFzg6bpf24PMDQCippaxMGLaHB0Wq5pAAAAFQAAAAAbwtOgde9K1dKvou7L7ky9CXSFX7jLdHklnuzl0IEpMAAAAAI2YzM3YTYxNQAAAAAAAAAAdb45pprwbDSBoXODpul/bg8wNAKKmlrEwYtocHRarmkAAAAAAAAAAQAAAAAAAAADIbnOjgAAAEAy9d9mWNtOwjAgWSatW4dmnK6z5AQKYiDGDYMAP0PYQ55XsPXKyR8aIO775L7EFR4oFubsPwlCS/OKUeburYMLwdKpJwAAAEATt/zrgkHcp4bwxJipQtcP2rTSV7JT51xMW6lXsyeN9NTIYgDdCdHQ8nqmjT45Qp5Y9ysfTo6x/EtNhp76LcMDdFquaQAAAEBlUa5rw7eHt73DRsYZLCeCcjl0MEYrDad8r6ALrZ+x8h/a8SGQO5MqEv/rqg6RkHYBSO+Sx55AcAe58E7tIF8D",
DefaultPublicKey )
});

return new SignableResponse
{
BlockchainResponse = response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
using Core.InfrastructureTests.Helpers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Nexus.Token.SDK;
using Nexus.Token.SDK.Requests;
using Nexus.Token.SDK.Responses;
using Nexus.Sdk.Token;
using Nexus.Sdk.Token.Requests;
using Nexus.Sdk.Token.Responses;

namespace Core.InfrastructureTests.Nexus.Repositories
{
Expand Down Expand Up @@ -96,7 +96,7 @@ public async Task Create_Creates_Account_TestAsync()
.Returns(Task.FromResult(true));
server.Setup(s => s.Accounts.CreateOnStellarAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<string>>(), It.IsAny<string>()))
.Returns(Task.FromResult(NexusSDKHelper.SignableResponse()));
server.Setup(s => s.Submit.OnStellarAsync(It.IsAny<StellarSubmitRequest>()))
server.Setup(s => s.Submit.OnStellarAsync(It.IsAny<IEnumerable<StellarSubmitSignatureRequest>>()))
.Returns(Task.CompletedTask);

var signingService = new Mock<ISigningService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using Core.InfrastructureTests.Helpers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Nexus.SDK.Shared.Requests;
using Nexus.Token.SDK;
using Nexus.Sdk.Shared.Requests;
using Nexus.Sdk.Token;

namespace Core.InfrastructureTests.Nexus.Repositories
{
Expand Down
8 changes: 4 additions & 4 deletions mobile/.env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXPO_PUBLIC_APP_NAME="[Dev] Quantoz Blockchain Solutions"
EXPO_PUBLIC_IOS_BUNDLE_IDENTIFIER=com.quantoz.qbs.dev
EXPO_PUBLIC_ANDROID_PACKAGE_NAME=com.quantoz.qbs.dev
EXPO_PUBLIC_SCHEME=quantoz.qbs.dev
APP_NAME="[Dev] Quantoz Blockchain Solutions"
IOS_BUNDLE_IDENTIFIER="com.quantoz.qbs.dev"
ANDROID_PACKAGE_NAME="com.quantoz.qbs.dev"
SCHEME="quantoz.qbs.dev"

8 changes: 4 additions & 4 deletions mobile/.env.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXPO_PUBLIC_APP_NAME="Quantoz Blockchain Solutions"
EXPO_PUBLIC_IOS_BUNDLE_IDENTIFIER=com.quantoz.qbs
EXPO_PUBLIC_ANDROID_PACKAGE_NAME=com.quantoz.qbs
EXPO_PUBLIC_SCHEME=quantoz.qbs
APP_NAME="Quantoz Blockchain Solutions"
IOS_BUNDLE_IDENTIFIER="com.quantoz.qbs"
ANDROID_PACKAGE_NAME="com.quantoz.qbs"
SCHEME="quantoz.qbs"

10 changes: 5 additions & 5 deletions mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
// - Expo Secrets (for build processes)

const AppConfig = {
name: process.env.EXPO_PUBLIC_APP_NAME,
name: process.env.APP_NAME,
icon: "./assets/icon-qbs.png",
image: "./assets/splash-qbs.png",
ios: {
bundleIdentifier: process.env.EXPO_PUBLIC_IOS_BUNDLE_IDENTIFIER,
bundleIdentifier: process.env.IOS_BUNDLE_IDENTIFIER,
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon-qbs.png",
},
package: process.env.EXPO_PUBLIC_ANDROID_PACKAGE_NAME,
package: process.env.ANDROID_PACKAGE_NAME,
},
// This logic sets the correct env variables to use throughout the app
// They can be read through the `expo-constants` package (https://docs.expo.dev/guides/environment-variables/#reading-environment-variables)
Expand Down Expand Up @@ -64,7 +64,7 @@ export default () => ({
},
assetBundlePatterns: ["**/*"],
ios: {
bundleIdentifier: AppConfig.ios.bundleIdentifier,
bundleIdentifier: process.env.IOS_BUNDLE_IDENTIFIER,
infoPlist: {
NSCameraUsageDescription:
"This app uses the camera to take photos of your documents, in order to upgrade to a higher tier.",
Expand Down Expand Up @@ -103,7 +103,7 @@ export default () => ({
},
],
],
scheme: process.env.EXPO_PUBLIC_SCHEME,
scheme: process.env.SCHEME,
platforms: ["ios", "android"],
runtimeVersion: {
policy: "sdkVersion",
Expand Down
19 changes: 10 additions & 9 deletions mobile/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
},
"env": {
"APP_ENV": "development",
"EXPO_PUBLIC_APP_NAME": "[Dev] Quantoz Blockchain Solutions",
"EXPO_PUBLIC_IOS_BUNDLE_IDENTIFIER": "com.quantoz.qbs.dev",
"EXPO_PUBLIC_ANDROID_PACKAGE_NAME": "com.quantoz.qbs.dev",
"EXPO_PUBLIC_SCHEME": "quantoz.qbs.dev"
"APP_NAME": "[Dev] Quantoz Blockchain Solutions",
"IOS_BUNDLE_IDENTIFIER": "com.quantoz.qbs.dev",
"ANDROID_PACKAGE_NAME": "com.quantoz.qbs.dev",
"SCHEME": "quantoz.qbs.dev"
}
},
"production": {
Expand All @@ -25,10 +25,10 @@
"distribution": "store",
"env": {
"APP_ENV": "production",
"EXPO_PUBLIC_APP_NAME": "Quantoz Blockchain Solutions",
"EXPO_PUBLIC_IOS_BUNDLE_IDENTIFIER": "com.quantoz.qbs",
"EXPO_PUBLIC_ANDROID_PACKAGE_NAME": "com.quantoz.qbs",
"EXPO_PUBLIC_SCHEME": "quantoz.qbs"
"APP_NAME": "Quantoz Blockchain Solutions",
"IOS_BUNDLE_IDENTIFIER": "com.quantoz.qbs",
"ANDROID_PACKAGE_NAME": "com.quantoz.qbs",
"SCHEME": "quantoz.qbs"
}
}
},
Expand All @@ -39,7 +39,8 @@
"track": "internal"
},
"ios": {
"ascAppId": "6446848462"
"ascAppId": "6446848462",
"bundleIdentifier": "com.quantoz.qbs"
}
}
}
Expand Down
Loading

0 comments on commit 476cd7b

Please sign in to comment.