Skip to content

Commit

Permalink
Merge pull request #1024 from Nethereum/mud
Browse files Browse the repository at this point in the history
Mud support
  • Loading branch information
juanfranblanco committed Apr 22, 2024
2 parents 07c75b2 + 74cabeb commit 3bcb0dc
Show file tree
Hide file tree
Showing 112 changed files with 11,061 additions and 20 deletions.
143 changes: 143 additions & 0 deletions Nethereum.sln
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NethereumWCAvalonia", "cons
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NethereumGodotAvalonia", "consoletests\NethereumGodotWCAvalonia\NethereumGodotAvalonia.csproj", "{6AE91750-F47C-4B12-BBA3-0F3DB273D45B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mud", "Mud", "{5B8B052D-60F9-48BD-B186-5EC802731AA9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nethereum.Mud", "src\Nethereum.Mud\Nethereum.Mud.csproj", "{142227D4-70BF-453A-896A-80C9229DD75A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nethereum.Mud.UnitTests", "tests\Nethereum.Mud.UnitTests\Nethereum.Mud.UnitTests.csproj", "{26778F22-0B46-496B-95AE-9BD1D7326BA9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nethereum.Mud.Contracts", "src\Nethereum.Mud.Contracts\Nethereum.Mud.Contracts.csproj", "{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nethereum.Mud.IntegrationTests", "tests\Nethereum.Mud.IntegrationTests\Nethereum.Mud.IntegrationTests.csproj", "{55E4030E-B165-4ADA-B952-8C6A04B37AE7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3300,6 +3310,134 @@ Global
{6AE91750-F47C-4B12-BBA3-0F3DB273D45B}.Release|x64.Build.0 = ExportRelease|Any CPU
{6AE91750-F47C-4B12-BBA3-0F3DB273D45B}.Release|x86.ActiveCfg = ExportRelease|Any CPU
{6AE91750-F47C-4B12-BBA3-0F3DB273D45B}.Release|x86.Build.0 = ExportRelease|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|ARM.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|x64.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|x64.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|x86.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Debug|x86.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|ARM.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|ARM.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|x64.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|x64.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|x86.ActiveCfg = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportDebug|x86.Build.0 = Debug|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|ARM.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|ARM.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|x64.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|x64.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|x86.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.ExportRelease|x86.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|Any CPU.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|ARM.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|ARM.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|x64.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|x64.Build.0 = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|x86.ActiveCfg = Release|Any CPU
{142227D4-70BF-453A-896A-80C9229DD75A}.Release|x86.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|ARM.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|ARM.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|x64.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|x64.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|x86.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Debug|x86.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|ARM.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|ARM.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|x64.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|x64.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|x86.ActiveCfg = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportDebug|x86.Build.0 = Debug|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|ARM.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|ARM.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|x64.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|x64.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|x86.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.ExportRelease|x86.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|Any CPU.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|ARM.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|ARM.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|x64.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|x64.Build.0 = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|x86.ActiveCfg = Release|Any CPU
{26778F22-0B46-496B-95AE-9BD1D7326BA9}.Release|x86.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|ARM.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|ARM.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|x64.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|x64.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|x86.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Debug|x86.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|ARM.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|ARM.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|x64.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|x64.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|x86.ActiveCfg = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportDebug|x86.Build.0 = Debug|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|ARM.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|ARM.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|x64.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|x64.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|x86.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.ExportRelease|x86.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|Any CPU.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|ARM.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|ARM.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|x64.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|x64.Build.0 = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|x86.ActiveCfg = Release|Any CPU
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9}.Release|x86.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|ARM.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|ARM.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|x64.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|x64.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|x86.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Debug|x86.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|ARM.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|ARM.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|x64.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|x64.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|x86.ActiveCfg = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportDebug|x86.Build.0 = Debug|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|ARM.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|ARM.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|x64.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|x64.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|x86.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.ExportRelease|x86.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|Any CPU.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|ARM.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|ARM.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|x64.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|x64.Build.0 = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|x86.ActiveCfg = Release|Any CPU
{55E4030E-B165-4ADA-B952-8C6A04B37AE7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -3437,6 +3575,11 @@ Global
{0DE289AE-6F4C-421C-AC6D-A09C2A957828} = {7125267C-FD3B-45CF-99C3-2A8BE11BBCC8}
{BBF4CD83-7374-4BFA-B837-F314CCFD977D} = {7125267C-FD3B-45CF-99C3-2A8BE11BBCC8}
{6AE91750-F47C-4B12-BBA3-0F3DB273D45B} = {7125267C-FD3B-45CF-99C3-2A8BE11BBCC8}
{5B8B052D-60F9-48BD-B186-5EC802731AA9} = {962EC435-6130-4B75-BAC1-12323B067443}
{142227D4-70BF-453A-896A-80C9229DD75A} = {5B8B052D-60F9-48BD-B186-5EC802731AA9}
{26778F22-0B46-496B-95AE-9BD1D7326BA9} = {5B8B052D-60F9-48BD-B186-5EC802731AA9}
{394FCBEC-5ECC-42A2-8CCE-7287CB4E3BA9} = {5B8B052D-60F9-48BD-B186-5EC802731AA9}
{55E4030E-B165-4ADA-B952-8C6A04B37AE7} = {5B8B052D-60F9-48BD-B186-5EC802731AA9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {07A44726-8749-4A9A-8079-FA3C3213BDC1}
Expand Down
2 changes: 1 addition & 1 deletion buildConf/Generic-CodeGen.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RepositoryUrl>https://github.com/Nethereum/Nethereum</RepositoryUrl>
<Description>Code generation of Nethereum integration classes using the Solidity Abi and Bin</Description>
<Copyright>Juan Blanco</Copyright>
<Version>4.20.0</Version>
<Version>4.20.1</Version>
<Authors>Juan Blanco,Nethereum contributors</Authors>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo.Clean
dotnet clean -c release
echo.Publishing
cd ../Nethereum.Generator.Console
dotnet publish -c release ---framework net5.0
dotnet publish -c release ---framework net8.0
echo.Packing
cd ../Nethereum.Autogen.ContractApi
dotnet pack -c release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Nethereum.Autogen.ContractApi</id>
<version>4.20.0</version>
<version>4.20.1</version>
<authors>Juan Blanco, Dave Whiffin</authors>
<owners>Juan Blanco</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -17,8 +17,8 @@
</metadata>

<files>
<file src="..\..\Nethereum.Generator.Console\bin\release\net5.0\publish\*.dll" target="tools" />
<file src="..\..\Nethereum.Generator.Console\bin\release\net5.0\publish\*.json" target="tools" />
<file src="..\..\Nethereum.Generator.Console\bin\release\net8.0\publish\*.dll" target="tools" />
<file src="..\..\Nethereum.Generator.Console\bin\release\net8.0\publish\*.json" target="tools" />
<file src="..\..\..\LICENSE.md" target="" />
<file src="Nethereum.Autogen.ContractApi.targets" target="build" />
</files>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<NugetVersion>4.11.0</NugetVersion>
<NugetVersion>4.20.1</NugetVersion>
</PropertyGroup>

<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\buildConf\Generic-CodeGen.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64;</RuntimeIdentifiers>
<PackAsTool>true</PackAsTool>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions src/Nethereum.ABI/ABIType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public ABIType(string name)
/// <returns> fixed size in bytes or negative value if the type is dynamic </returns>
public virtual int FixedSize => 32;

/// <returns> static size in bytes or negative value if the type is dynamic </returns>
public virtual int StaticSize => FixedSize;

public static ABIType CreateABIType(string typeName)
{
if (typeName == "tuple") return new TupleType();
Expand Down Expand Up @@ -103,5 +106,20 @@ public override string ToString()
{
return Name;
}

public object DecodePacked(byte[] encodedElement, Type elementType)
{
return Decoder.DecodePacked(encodedElement, elementType);
}

public T DecodePacked<T>(string encoded)
{
return Decoder.DecodePacked<T>(encoded);
}

public T DecodePacked<T>(byte[] encoded)
{
return Decoder.DecodePacked<T>(encoded);
}
}
}
2 changes: 2 additions & 0 deletions src/Nethereum.ABI/AddressType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace Nethereum.ABI
{
public class AddressType : ABIType
{
public override int StaticSize => 20;

public AddressType() : base("address")
{
//this will need to be only a string type one, converting to hex
Expand Down
4 changes: 4 additions & 0 deletions src/Nethereum.ABI/ArrayType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ protected ArrayType(string name) : base(name)
InitialiseElementType(name);
}

public abstract object DecodePackedUsingElementPacked(byte[] encoded, Type type);
public abstract byte[] EncodePackedUsingElementPacked(object value);


public new static ArrayType CreateABIType(string typeName)
{
var indexFirstBracket = typeName.LastIndexOf("[", StringComparison.Ordinal);
Expand Down
1 change: 1 addition & 0 deletions src/Nethereum.ABI/BoolType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Nethereum.ABI
{
public class BoolType : ABIType
{
public override int StaticSize => 1;
public BoolType() : base("bool")
{
Decoder = new BoolTypeDecoder();
Expand Down
1 change: 1 addition & 0 deletions src/Nethereum.ABI/Bytes32Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Nethereum.ABI
{
public class Bytes32Type : ABIType
{
override public int StaticSize => 32;
public Bytes32Type(string name) : base(name)
{
Decoder = new Bytes32TypeDecoder();
Expand Down
2 changes: 2 additions & 0 deletions src/Nethereum.ABI/BytesElementaryType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ namespace Nethereum.ABI
{
public class BytesElementaryType : ABIType
{
public override int StaticSize { get; }
public BytesElementaryType(string name, int size) : base(name)
{
StaticSize = size;
Decoder = new BytesElementaryTypeDecoder(size);
Encoder = new BytesElementaryTypeEncoder(size);
}
Expand Down
7 changes: 7 additions & 0 deletions src/Nethereum.ABI/Decoders/AddressTypeDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ public override object Decode(byte[] encoded, Type type)
return output.ToHex(true).ConvertToEthereumChecksumAddress();
}

public override object DecodePacked(byte[] encoded, Type type)
{
if (!IsSupportedType(type)) throw new NotSupportedException(type + " is not supported");
if(encoded.Length != 20) throw new Exception("Invalid address (should be 20 bytes length): " + encoded.ToHex());
return encoded.ToHex(true).ConvertToEthereumChecksumAddress();
}

public override Type GetDefaultDecodingType()
{
return typeof(string);
Expand Down

0 comments on commit 3bcb0dc

Please sign in to comment.