Skip to content

Commit

Permalink
Fix post merge master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Apolixit committed Jan 31, 2024
1 parent 5cdc9f1 commit 436e6c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
21 changes: 0 additions & 21 deletions Substrate.NetApi.Test/Keys/Sr25519Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,5 @@ public void Sr25519SignatureTestComparePolkadotJs(string polkadotJsSignature)
var simpleSign2 = Utils.HexToByteArray(polkadotJsSignature);
Assert.True(Substrate.NET.Schnorrkel.Sr25519v091.Verify(simpleSign2, keyPairAlice.Public.Key, messageBytes));
}

[Test]
[TestCase("0x5c42ac4e2d55b8e59d9b255af370de03fe177f5545eecbbd784531cb2eb1f2553e0e2b91656f99fae930eb6ff8ac1a3eca4e19d307ecb39832a479a478a8608a")]
public async Task AccountSr25519SignatureTestComparePolkadotJsAsync(string polkadotJsSignature)
{
var miniSecretAlice = new MiniSecret(Utils.HexToByteArray("0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a"), ExpandMode.Ed25519);

// var account = Account.Build(KeyType.Sr25519, miniSecretAlice.ExpandToSecret().ToEd25519Bytes(), miniSecretAlice.GetPair().Public.Key);

// var message = "I test this signature!";
// var messageBytes = WrapMessage.Wrap(message);

var signature1 = await Task.Run(() => account.Sign(messageBytes));
var signature2 = await account.SignAsync(messageBytes);

Assert.True(account.Verify(signature1, account.Bytes, messageBytes));
Assert.True(account.Verify(signature2, account.Bytes, messageBytes));

var signature3 = Utils.HexToByteArray(polkadotJsSignature);
Assert.True(account.Verify(signature3, account.Bytes, messageBytes));
}
}
}
4 changes: 2 additions & 2 deletions Substrate.NetApi.TestNode/ExtrinsicsTest.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using NUnit.Framework;
using NUnit.Framework.Internal;
using Schnorrkel.Keys;
using Substrate.NET.Schnorrkel.Keys;
using Substrate.NetApi.Model.Extrinsics;
using Substrate.NetApi.Model.Rpc;
using Substrate.NetApi.Model.Types;
using Substrate.NetApi.Model.Types.Base;
using System;
using System.Threading;
using Substrate.NET.System.Threading.Tasks;
using System.Threading.Tasks;

namespace Substrate.NetApi.TestNode
{
Expand Down
1 change: 1 addition & 0 deletions Substrate.NetApi.TestNode/Substrate.NetApi.TestNode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Substrate.NET.Schnorrkel" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 436e6c2

Please sign in to comment.