-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more overloads to storage api (#3)
- Loading branch information
1 parent
a11a801
commit a39bf83
Showing
1 changed file
with
29 additions
and
14 deletions.
There are no files selected for viewing
43 changes: 29 additions & 14 deletions
43
src/AntShares.SmartContract.Framework/Services/AntShares/Storage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
namespace AntShares.SmartContract.Framework.Services.AntShares | ||
{ | ||
public class Storage | ||
{ | ||
[Syscall("AntShares.Storage.Get")] | ||
public extern byte[] Get(StorageContext context, byte[] key); | ||
|
||
[Syscall("AntShares.Storage.Put")] | ||
public extern void Put(StorageContext context, byte[] key, byte[] value); | ||
|
||
[Syscall("AntShares.Storage.Delete")] | ||
public extern void Delete(StorageContext context, byte[] key); | ||
} | ||
} | ||
namespace AntShares.SmartContract.Framework.Services.AntShares | ||
{ | ||
public class Storage | ||
{ | ||
[Syscall("AntShares.Storage.Get")] | ||
public extern byte[] Get(StorageContext context, byte[] key); | ||
|
||
[Syscall("AntShares.Storage.Get")] | ||
public extern byte[] Get(StorageContext context, string key); | ||
|
||
[Syscall("AntShares.Storage.Put")] | ||
public extern void Put(StorageContext context, byte[] key, byte[] value); | ||
|
||
[Syscall("AntShares.Storage.Put")] | ||
public extern void Put(StorageContext context, byte[] key, string value); | ||
|
||
[Syscall("AntShares.Storage.Put")] | ||
public extern void Put(StorageContext context, string key, byte[] value); | ||
|
||
[Syscall("AntShares.Storage.Put")] | ||
public extern void Put(StorageContext context, string key, string value); | ||
|
||
[Syscall("AntShares.Storage.Delete")] | ||
public extern void Delete(StorageContext context, byte[] key); | ||
|
||
[Syscall("AntShares.Storage.Delete")] | ||
public extern void Delete(StorageContext context, string key); | ||
} | ||
} |