Skip to content

Commit

Permalink
🔖 Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco committed Dec 16, 2024
1 parent 5f20f9b commit f602a07
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SharedBuildProperties.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Product>Solana.Unity.Anchor</Product>
<Version>0.2.13</Version>
<Version>0.2.14</Version>
<Copyright>Copyright 2023 &#169; Magicblock</Copyright>
<Authors>Magicblock</Authors>
<PublisherName>Magicblock</PublisherName>
Expand Down
331 changes: 331 additions & 0 deletions Solana.Unity.Anchor.Test/Resources/Hero.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,331 @@
{
"address": "GBzY8ujNDb1FNkJUXUUjKV5uZPqzi6AoKsPjsqFEHCeh",
"metadata": {
"name": "hero",
"version": "0.1.10",
"spec": "0.1.0",
"description": "Created with Bolt"
},
"instructions": [
{
"name": "delegate",
"discriminator": [
90,
147,
75,
178,
85,
88,
4,
137
],
"accounts": [
{
"name": "payer",
"signer": true
},
{
"name": "entity"
},
{
"name": "account",
"writable": true
},
{
"name": "owner_program"
},
{
"name": "buffer",
"writable": true
},
{
"name": "delegation_record",
"writable": true
},
{
"name": "delegate_account_seeds",
"writable": true
},
{
"name": "delegation_program"
},
{
"name": "system_program"
}
],
"args": [
{
"name": "valid_until",
"type": "i64"
},
{
"name": "commit_frequency_ms",
"type": "u32"
}
]
},
{
"name": "initialize",
"discriminator": [
175,
175,
109,
31,
13,
152,
155,
237
],
"accounts": [
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "data",
"writable": true
},
{
"name": "entity"
},
{
"name": "authority"
},
{
"name": "instruction_sysvar_account",
"address": "Sysvar1nstructions1111111111111111111111111"
},
{
"name": "system_program",
"address": "11111111111111111111111111111111"
}
],
"args": []
},
{
"name": "process_undelegation",
"discriminator": [
196,
28,
41,
206,
48,
37,
51,
167
],
"accounts": [
{
"name": "delegated_account",
"writable": true
},
{
"name": "buffer"
},
{
"name": "payer",
"writable": true
},
{
"name": "system_program"
}
],
"args": [
{
"name": "account_seeds",
"type": {
"vec": "bytes"
}
}
]
},
{
"name": "undelegate",
"discriminator": [
131,
148,
180,
198,
91,
104,
42,
238
],
"accounts": [
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "delegated_account",
"writable": true
},
{
"name": "magic_context",
"writable": true,
"address": "MagicContext1111111111111111111111111111111"
},
{
"name": "magic_program",
"address": "Magic11111111111111111111111111111111111111"
}
],
"args": []
},
{
"name": "update",
"discriminator": [
219,
200,
88,
176,
158,
63,
253,
127
],
"accounts": [
{
"name": "bolt_component",
"writable": true
},
{
"name": "authority"
},
{
"name": "instruction_sysvar_account",
"address": "Sysvar1nstructions1111111111111111111111111"
}
],
"args": [
{
"name": "data",
"type": "bytes"
}
]
}
],
"accounts": [
{
"name": "Entity",
"discriminator": [
46,
157,
161,
161,
254,
46,
79,
24
]
},
{
"name": "Hero",
"discriminator": [
12,
63,
39,
30,
183,
229,
154,
172
]
}
],
"types": [
{
"name": "BoltMetadata",
"docs": [
"Metadata for the component."
],
"type": {
"kind": "struct",
"fields": [
{
"name": "authority",
"type": "pubkey"
}
]
}
},
{
"name": "Entity",
"type": {
"kind": "struct",
"fields": [
{
"name": "id",
"type": "u64"
}
]
}
},
{
"name": "Hero",
"type": {
"kind": "struct",
"fields": [
{
"name": "x",
"type": "i32"
},
{
"name": "y",
"type": "i32"
},
{
"name": "last_activity",
"type": "i64"
},
{
"name": "owner",
"type": "pubkey"
},
{
"name": "backpack",
"type": {
"defined": {
"name": "ResourceBalance"
}
}
},
{
"name": "bolt_metadata",
"type": {
"defined": {
"name": "BoltMetadata"
}
}
}
]
}
},
{
"name": "ResourceBalance",
"type": {
"kind": "struct",
"fields": [
{
"name": "food",
"type": "u16"
},
{
"name": "water",
"type": "u16"
},
{
"name": "wood",
"type": "u16"
},
{
"name": "stone",
"type": "u16"
}
]
}
}
]
}
3 changes: 3 additions & 0 deletions Solana.Unity.Anchor.Test/Solana.Unity.Anchor.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<None Update="Resources\WorldNew.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Hero.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions Solana.Unity.Anchor.Test/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ public void TestBoltWorldNewProgramParsing()
var code = c.GenerateCode(res);
Assert.IsNotNull(code);
}

[TestMethod]
public void TestHerosParsing()
{
var res = IdlParser.ParseFile("Resources/Hero.json");
Assert.IsNotNull(res);

ClientGenerator c = new();

c.GenerateSyntaxTree(res);
Assert.IsNotNull(c);

var code = c.GenerateCode(res);
Assert.IsNotNull(code);
}
}
}

0 comments on commit f602a07

Please sign in to comment.