Introduce Vexer platform scaffolding and enrich Concelier merge
This commit is contained in:
33
src/StellaOps.Vexer.Storage.Mongo/VexMongoMappingRegistry.cs
Normal file
33
src/StellaOps.Vexer.Storage.Mongo/VexMongoMappingRegistry.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Threading;
|
||||
using MongoDB.Bson.Serialization;
|
||||
using MongoDB.Bson.Serialization.Serializers;
|
||||
|
||||
namespace StellaOps.Vexer.Storage.Mongo;
|
||||
|
||||
public static class VexMongoMappingRegistry
|
||||
{
|
||||
private static int _initialized;
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
if (Interlocked.Exchange(ref _initialized, 1) == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!BsonSerializer.IsSerializerRegistered(typeof(byte[])))
|
||||
{
|
||||
BsonSerializer.RegisterSerializer(new ByteArraySerializer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class VexMongoCollectionNames
|
||||
{
|
||||
public const string Providers = "vex.providers";
|
||||
public const string Raw = "vex.raw";
|
||||
public const string Claims = "vex.claims";
|
||||
public const string Consensus = "vex.consensus";
|
||||
public const string Exports = "vex.exports";
|
||||
public const string Cache = "vex.cache";
|
||||
}
|
||||
Reference in New Issue
Block a user