Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type errors #582

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Lib9c.Models/Runes/RuneSlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public record RuneSlot : IBencodable

public RuneSlot() { }

[BsonIgnore, GraphQLIgnore]
public IValue Bencoded
{
get
Expand Down
2 changes: 1 addition & 1 deletion Mimir.MongoDB/Repositories/RuneSlotRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface IRuneSlotRepository
Task<RuneSlotDocument> GetByAddressAsync(Address avatarAddress, BattleType battleType);
}

public class RuneSlotRepository(MongoDbService dbService) : IRuneSlotRepository
public class RuneSlotRepository(IMongoDbService dbService) : IRuneSlotRepository
{
public async Task<RuneSlotDocument> GetByAddressAsync(
Address avatarAddress,
Expand Down
10 changes: 5 additions & 5 deletions Mimir.Worker/ActionHandler/ItemSlotStateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected override async Task<IEnumerable<WriteModel<BsonDocument>>> HandleActio
{
var action = new HackAndSlashSweep();
action.LoadPlainValue(actionPlainValue);
await ItemSlotCollectionUpdater.UpdateAsync(
return await ItemSlotCollectionUpdater.UpdateAsync(
StateService,
blockIndex,
BattleType.Adventure,
Expand All @@ -70,7 +70,7 @@ await ItemSlotCollectionUpdater.UpdateAsync(
{
var action = new BattleArena();
action.LoadPlainValue(actionPlainValue);
await ItemSlotCollectionUpdater.UpdateAsync(
return await ItemSlotCollectionUpdater.UpdateAsync(
StateService,
blockIndex,
BattleType.Arena,
Expand All @@ -83,7 +83,7 @@ await ItemSlotCollectionUpdater.UpdateAsync(
{
var action = new EventDungeonBattle();
action.LoadPlainValue(actionPlainValue);
await ItemSlotCollectionUpdater.UpdateAsync(
return await ItemSlotCollectionUpdater.UpdateAsync(
StateService,
blockIndex,
BattleType.Adventure,
Expand All @@ -96,7 +96,7 @@ await ItemSlotCollectionUpdater.UpdateAsync(
{
var action = new JoinArena();
action.LoadPlainValue(actionPlainValue);
await ItemSlotCollectionUpdater.UpdateAsync(
return await ItemSlotCollectionUpdater.UpdateAsync(
StateService,
blockIndex,
BattleType.Arena,
Expand Down Expand Up @@ -144,7 +144,7 @@ await ItemSlotCollectionUpdater.UpdateAsync(
.Cast<Binary>()
.Select(x => new Guid(x.ToByteArray()));
var costumeIds = costumeIdsList.Cast<Binary>().Select(x => new Guid(x.ToByteArray()));
await ItemSlotCollectionUpdater.UpdateAsync(
return await ItemSlotCollectionUpdater.UpdateAsync(
StateService,
blockIndex,
BattleType.Raid,
Expand Down
36 changes: 0 additions & 36 deletions Mimir.Worker/ActionHandler/RuneSlotStateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.runeInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand All @@ -139,12 +133,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.RuneInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand All @@ -160,12 +148,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.RuneInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand All @@ -181,12 +163,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.runeInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand All @@ -202,12 +178,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.runeInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand All @@ -223,12 +193,6 @@ private async Task<IEnumerable<WriteModel<BsonDocument>>> TryProcessRuneSlotStat
CancellationToken stoppingToken = default
)
{
if (action.RuneInfos is null)
{
// ignore
return [];
}

return await RuneSlotCollectionUpdater.UpdateAsync(
blockIndex,
StateService,
Expand Down
22 changes: 11 additions & 11 deletions Mimir.Worker/HostApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ public static HostApplicationBuilder ConfigureHandlers(this HostApplicationBuild
&& pollerType == PollerType.TxPoller
)
{
builder.Services.AddBackgroundService<ArenaStateHandler>();
// builder.Services.AddBackgroundService<ArenaStateHandler>();
builder.Services.AddBackgroundService<ItemSlotStateHandler>();
builder.Services.AddBackgroundService<PetStateHandler>();
builder.Services.AddBackgroundService<PledgeStateHandler>();
builder.Services.AddBackgroundService<PledgeStateHandler>();
builder.Services.AddBackgroundService<ProductsStateHandler>();
builder.Services.AddBackgroundService<ProductStateHandler>();
builder.Services.AddBackgroundService<RaiderStateHandler>();
builder.Services.AddBackgroundService<StakeStateHandler>();
// builder.Services.AddBackgroundService<PetStateHandler>();
// builder.Services.AddBackgroundService<PledgeStateHandler>();
// builder.Services.AddBackgroundService<PledgeStateHandler>();
// builder.Services.AddBackgroundService<ProductsStateHandler>();
// builder.Services.AddBackgroundService<ProductStateHandler>();
// builder.Services.AddBackgroundService<RaiderStateHandler>();
// builder.Services.AddBackgroundService<StakeStateHandler>();
builder.Services.AddBackgroundService<RuneSlotStateHandler>();
builder.Services.AddBackgroundService<TableSheetStateHandler>();
builder.Services.AddBackgroundService<WorldBossKillRewardRecordStateHandler>();
builder.Services.AddBackgroundService<WorldBossStateHandler>();
// builder.Services.AddBackgroundService<TableSheetStateHandler>();
// builder.Services.AddBackgroundService<WorldBossKillRewardRecordStateHandler>();
// builder.Services.AddBackgroundService<WorldBossStateHandler>();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Mimir/GraphQL/Queries/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ [Service] IItemSlotRepository repo
/// </summary>
/// <param name="address">The address of the avatar.</param>
/// <param name="battleType">The battleType.</param>
/// <returns>The stake state.</returns>
/// <returns>The rune slot state.</returns>
public async Task<RuneSlotState?> GetRuneSlotAsync(
Address address,
BattleType battleType,
Expand Down
Loading