-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified the code to reflect current design
- Loading branch information
Showing
6 changed files
with
44 additions
and
75 deletions.
There are no files selected for viewing
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
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
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
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,7 +1,31 @@ | ||
namespace AElf.Kernel.KernelAccount | ||
using System.Threading.Tasks; | ||
|
||
namespace AElf.Kernel.KernelAccount | ||
{ | ||
public class SmartContractZero | ||
{ | ||
private const string SMART_CONTRACT_MAP_KEY = "SmartContractMap"; | ||
|
||
private IAccountDataProvider _accountDataProvider; | ||
|
||
public async void InititalizeAsync(IAccountDataProvider dataProvider) | ||
{ | ||
_accountDataProvider = dataProvider; | ||
} | ||
|
||
public async Task InvokeAsync(IHash<IAccount> caller, string methodname, params object[] objs) | ||
{ | ||
var type = typeof(SmartContractZero); | ||
var member = type.GetMethod(methodname); | ||
|
||
await (Task) member.Invoke(this, objs); | ||
} | ||
|
||
// Hard coded method in the kernel | ||
public async Task RegisterSmartContract(SmartContractRegistration reg) | ||
{ | ||
var smartContractMap = (IAccountDataProvider) await _accountDataProvider.GetMapAsync(SMART_CONTRACT_MAP_KEY); | ||
await smartContractMap.SetAsync(reg.Hash, reg); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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