Skip to content

Commit

Permalink
Rebase fix
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed Oct 5, 2023
1 parent b728acc commit dfe4bf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .Lib9c.Tests/Action/ClaimItemsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void Execute_Throws_ArgumentException_TickerInvalid()
PreviousState = state,
Signer = _signerAddress,
BlockIndex = 100,
Random = new TestRandom(),
RandomSeed = 0,
}));
}

Expand All @@ -112,7 +112,7 @@ public void Execute_Throws_WhenNotEnoughBalance()
PreviousState = state,
Signer = _signerAddress,
BlockIndex = 100,
Random = new TestRandom(),
RandomSeed = 0,
}));
}

Expand All @@ -131,7 +131,7 @@ public void Execute()
PreviousState = state,
Signer = _signerAddress,
BlockIndex = 0,
Random = new TestRandom(),
RandomSeed = 0,
});

var inventory = states.GetInventory(recipientAvatarAddress.Derive(SerializeKeys.LegacyInventoryKey));
Expand Down Expand Up @@ -167,7 +167,7 @@ public void Execute_WithMultipleRecipients()
PreviousState = state,
Signer = _signerAddress,
BlockIndex = 0,
Random = new TestRandom(),
RandomSeed = 0,
});

Assert.Equal(states.GetBalance(_signerAddress, _currencies[0]), _currencies[0] * 3);
Expand Down
3 changes: 2 additions & 1 deletion Lib9c/Action/ClaimItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public override IAccount Execute(IActionContext context)
context.UseGas(1);

var states = context.PreviousState;
var random = context.GetRandom();
var itemSheet = states.GetSheets(containItemSheet: true).GetItemSheet();

foreach (var (avatarAddress, fungibleAssetValues) in ClaimData)
Expand Down Expand Up @@ -94,7 +95,7 @@ public override IAccount Execute(IActionContext context)
MaterialItemSheet.Row materialRow => parsedTicker[1] == "T"
? ItemFactory.CreateTradableMaterial(materialRow)
: ItemFactory.CreateMaterial(materialRow),
var itemRow => ItemFactory.CreateItem(itemRow, context.Random)
var itemRow => ItemFactory.CreateItem(itemRow, random)
};

inventory.AddItem(item, (int)fungibleAssetValue.RawValue);
Expand Down

0 comments on commit dfe4bf9

Please sign in to comment.