Skip to content

Commit

Permalink
upgrade to AntShares.SmartContract.Framework 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Zhang committed Jun 6, 2017
1 parent 671fb7d commit 479ac32
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 27 deletions.
1 change: 1 addition & 0 deletions AgencyTransaction/AgencyTransaction.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using AntShares.SmartContract.Framework;
using AntShares.SmartContract.Framework.Services.AntShares;
using AntShares.SmartContract.Framework.Services.System;
using System.Numerics;

namespace AntShares.SmartContract
Expand Down
7 changes: 3 additions & 4 deletions AgencyTransaction/AgencyTransaction.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AntShares.SmartContract.Framework, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.1.6.0-preview4\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
<Private>True</Private>
<Reference Include="AntShares.SmartContract.Framework, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.2.0.0\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -50,8 +49,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="build.tasks" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AntShares.ILConvertPlugin.dll" />
Expand Down
2 changes: 1 addition & 1 deletion AgencyTransaction/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AntShares.SmartContract.Framework" version="1.6.0-preview4" targetFramework="net40" />
<package id="AntShares.SmartContract.Framework" version="2.0.0" targetFramework="net462" />
</packages>
14 changes: 7 additions & 7 deletions Domain/Domain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ public static object Main(string operation, params object[] args)

private static byte[] Query(string domain)
{
return Storage.Get(StorageContext.Current, domain);
return Storage.Get(Storage.CurrentContext, domain);
}

private static bool Register(string domain, byte[] owner, byte[] signature)
{
if (!VerifySignature(owner, signature)) return false;
byte[] value = Storage.Get(StorageContext.Current, domain);
byte[] value = Storage.Get(Storage.CurrentContext, domain);
if (value != null) return false;
Storage.Put(StorageContext.Current, domain, owner);
Storage.Put(Storage.CurrentContext, domain, owner);
return true;
}

private static bool Transfer(string domain, byte[] signature_from, byte[] to, byte[] signature_to)
{
if (!VerifySignature(to, signature_to)) return false;
byte[] from = Storage.Get(StorageContext.Current, domain);
byte[] from = Storage.Get(Storage.CurrentContext, domain);
if (from == null) return false;
if (!VerifySignature(from, signature_from)) return false;
Storage.Put(StorageContext.Current, domain, to);
Storage.Put(Storage.CurrentContext, domain, to);
return true;
}

private static bool Delete(string domain, byte[] signature)
{
byte[] owner = Storage.Get(StorageContext.Current, domain);
byte[] owner = Storage.Get(Storage.CurrentContext, domain);
if (owner == null) return false;
if (!VerifySignature(owner, signature)) return false;
Storage.Delete(StorageContext.Current, domain);
Storage.Delete(Storage.CurrentContext, domain);
return true;
}
}
Expand Down
7 changes: 3 additions & 4 deletions Domain/Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AntShares.SmartContract.Framework, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.1.6.0-preview8\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
<Private>True</Private>
<Reference Include="AntShares.SmartContract.Framework, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.2.0.0\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -50,8 +49,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="build.tasks" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AntShares.ILConvertPlugin.dll" />
Expand Down
2 changes: 1 addition & 1 deletion Domain/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AntShares.SmartContract.Framework" version="1.6.0-preview8" targetFramework="net40" />
<package id="AntShares.SmartContract.Framework" version="2.0.0" targetFramework="net462" />
</packages>
2 changes: 1 addition & 1 deletion HelloWorld/HelloWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class HelloWorld : FunctionCode
{
public static void Main()
{
Storage.Put(StorageContext.Current, "Hello", "World");
Storage.Put(Storage.CurrentContext, "Hello", "World");
}
}
}
5 changes: 2 additions & 3 deletions HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AntShares.SmartContract.Framework, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.1.6.0-preview8\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
<Private>True</Private>
<Reference Include="AntShares.SmartContract.Framework, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.2.0.0\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion HelloWorld/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AntShares.SmartContract.Framework" version="1.6.0-preview8" targetFramework="net462" />
<package id="AntShares.SmartContract.Framework" version="2.0.0" targetFramework="net462" />
</packages>
7 changes: 3 additions & 4 deletions Lock/Lock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AntShares.SmartContract.Framework, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.1.6.0-preview4\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
<Private>True</Private>
<Reference Include="AntShares.SmartContract.Framework, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\AntShares.SmartContract.Framework.2.0.0\lib\net40\AntShares.SmartContract.Framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -50,8 +49,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="build.tasks" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AntShares.ILConvertPlugin.dll" />
Expand Down
2 changes: 1 addition & 1 deletion Lock/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AntShares.SmartContract.Framework" version="1.6.0-preview4" targetFramework="net40" />
<package id="AntShares.SmartContract.Framework" version="2.0.0" targetFramework="net462" />
</packages>

0 comments on commit 479ac32

Please sign in to comment.