Refactored C contract lib interface. (#175)

This commit is contained in:
Ravin Perera
2020-11-30 10:03:06 +05:30
committed by GitHub
parent 332e5a4750
commit efbd775fa1
4 changed files with 286 additions and 386 deletions

View File

@@ -55,19 +55,12 @@ class ContractExecutionContext {
#controlChannel = null;
constructor(hpargs, users, peers, controlChannel) {
this.#controlChannel = controlChannel;
this.readonly = hpargs.readonly;
this.timestamp = hpargs.ts;
this.users = users;
this.peers = peers;
this.#controlChannel = controlChannel;
if (!hpargs.readonly) {
const lclParts = hpargs.lcl.split("-");
this.lcl = {
seqNo: parseInt(lclParts[0]),
hash: lclParts[1]
};
}
this.peers = peers; // Not available in readonly mode.
this.lcl = hpargs.lcl; // Not available in readonly mode.
}
async updateUnl(addArray, removeArray) {