Skip to content

Commit

Permalink
Merge pull request #2361 from planetarium/90-merge-main
Browse files Browse the repository at this point in the history
90 merge main
  • Loading branch information
ipdae authored Dec 18, 2023
2 parents d5c4b97 + bceff65 commit d1d2ccb
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 482 deletions.
2 changes: 1 addition & 1 deletion Lib9c
Submodule Lib9c updated 341 files
17 changes: 15 additions & 2 deletions NineChronicles.Headless.Executable/Commands/GenesisCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ out List<CreatePledge> pledgeActions
[Command(Description = "Mine a new genesis block")]
public void Mine(
[Argument("CONFIG", Description = "JSON config path to mine genesis block")]
string configPath)
string configPath = "./config.json")
{
var options = new JsonSerializerOptions
{
Expand Down Expand Up @@ -275,7 +275,7 @@ public void Mine(
initialValidators: initialValidatorSet.ToDictionary(
item => new PublicKey(ByteUtil.ParseHex(item.PublicKey)),
item => new BigInteger(item.Power)),
actionBases: adminMeads.Concat(initialMeads).Concat(initialPledges),
actionBases: adminMeads.Concat(initialMeads).Concat(initialPledges).Concat(GetAdditionalActionBases()),
goldCurrency: currency
);

Expand Down Expand Up @@ -320,6 +320,19 @@ public void Mine(
}
}

/// <summary>
/// Actions to be appended on end of transaction actions.
/// You can add actions code to this method before generate genesis block.
/// </summary>
/// <returns></returns>
private static List<ActionBase> GetAdditionalActionBases()
{
return new List<ActionBase>
{

};
}

#pragma warning disable S3459
/// <summary>
/// Game data to set into genesis block.
Expand Down
7 changes: 3 additions & 4 deletions NineChronicles.Headless.Executable/Commands/MarketCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public void Query(
[Option(
'T',
Description = "Filter by item type. This implicitly filters out transactions " +
"made with " + nameof(Buy) + " action version prior to " + nameof(Buy5) +
". This can be applied multiple times (meaning: match any of them). " +
"The list of available types can be found in " + nameof(ItemSubType) +
" enum declared in Lib9c/Model/Item/ItemType.cs file.")]
"made with " + nameof(Buy) + ". This can be applied multiple times " +
"(meaning: match any of them). The list of available types can be found in " +
nameof(ItemSubType) + " enum declared in Lib9c/Model/Item/ItemType.cs file.")]
string[]? itemType = null,
[Option('c', Description = "Optional chain ID. Default is the canonical chain ID.")]
Guid? chainId = null
Expand Down
182 changes: 0 additions & 182 deletions NineChronicles.Headless.Tests/Controllers/GraphQLControllerTest.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ public async Task MonsterCollect()
}
}";

ActionBase createAvatar = new CreateAvatar2
ActionBase createAvatar = new CreateAvatar
{
index = 0,
hair = 0,
Expand Down Expand Up @@ -768,7 +768,7 @@ public async Task ClaimMonsterCollectionReward()
}}
}}";

ActionBase createAvatar = new CreateAvatar2
ActionBase createAvatar = new CreateAvatar
{
index = 0,
hair = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ public async Task MonsterCollectionStatus_MonsterCollectionState_Null(bool miner
{
StandaloneContextFx.NineChroniclesNodeService.MinerPrivateKey = null;
}
var action = new CreateAvatar2
var action = new CreateAvatar
{
index = 0,
hair = 1,
Expand Down Expand Up @@ -786,7 +786,7 @@ public async Task Avatar()
var service = MakeNineChroniclesNodeService(userPrivateKey);
StandaloneContextFx.NineChroniclesNodeService = service;
StandaloneContextFx.BlockChain = service.Swarm!.BlockChain;
var action = new CreateAvatar2
var action = new CreateAvatar
{
index = 0,
hair = 1,
Expand All @@ -806,7 +806,7 @@ public async Task Avatar()
var avatarAddress = userAddress.Derive(
string.Format(
CultureInfo.InvariantCulture,
CreateAvatar2.DeriveFormat,
CreateAvatar.DeriveFormat,
0
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public async Task SubscribeTx()
var observable = stream.Take(1);

var targetAction = new Grinding { AvatarAddress = new Address(), EquipmentIds = new List<Guid>() };
var nonTargetAction = new DailyReward6 { avatarAddress = new Address() };
var nonTargetAction = new DailyReward { avatarAddress = new Address() };

Task<ExecutionResult> task = Task.Run(async () => await observable);
var (block, transactions) = AppendBlock(targetAction, nonTargetAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public async Task GetTx()
data
);

var action = new CreateAvatar2
var action = new CreateAvatar
{
index = 0,
hair = 1,
Expand Down Expand Up @@ -165,7 +165,7 @@ public async Task CreateUnsignedTx(long? nonce)
PublicKey publicKey = privateKey.PublicKey;
Address signer = publicKey.Address;
long expectedNonce = nonce ?? _blockChain.GetNextTxNonce(signer);
ActionBase action = new CreateAvatar2
ActionBase action = new CreateAvatar
{
index = 0,
hair = 1,
Expand Down
Loading

0 comments on commit d1d2ccb

Please sign in to comment.