public MongoDBAuditTrailStore(IMongoClient client, IOptions <MongoDBStoreOptions> options, ILogger <MongoDBAuditTrailStore> logger, IMerkleTree?tree = null)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _client  = client ?? throw new ArgumentNullException(nameof(client));
            _options = options.Value;
            _logger  = logger ?? throw new ArgumentNullException(nameof(logger));
            _tree    = tree;
            var db = _client.GetDatabase(_options.Database);

            _auditTrails = db.GetCollection <AuditTrailBlock>("audit_trail");
            _keyring     = db.GetCollection <Keyring>("keyring");

            EnsureIndexes();
        }
        public MongoDBMerkleTree(IMongoClient client, IMerkleHasher hasher, IMerkleSigner signer, IOptions <MongoDBStoreOptions> options, ILogger <MongoDBMerkleTree> logger)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _client  = client ?? throw new ArgumentNullException(nameof(client));
            _hasher  = hasher ?? throw new ArgumentNullException(nameof(hasher));
            _signer  = signer ?? throw new ArgumentNullException(nameof(signer));
            _options = options.Value;
            var db = client.GetDatabase(_options.Database);

            _roots  = db.GetCollection <MerkleRoot>("merkle_roots");
            _nodes  = db.GetCollection <MerkleNode>("merkle_nodes");
            _leaves = db.GetCollection <MerkleLeaf>("merkle_leaves");
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            EnsureIndexes();
        }