Skip to content

Commit

Permalink
fix: calling address in orchestration
Browse files Browse the repository at this point in the history
  • Loading branch information
lydiagarms committed Sep 13, 2024
1 parent baf0ab5 commit 6f33332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ export const preimageBoilerPlate = (node: any) => {
default:
// TODO - this is the case where the owner is an admin (state var)
// we have to let the user submit the key and check it in the contract
if (!stateNode.ownerIsSecret && !stateNode.ownerIsParam) {
if (stateNode.mappingOwnershipType === 'key') {
newOwnerStatment = `generalise(await instance.methods.zkpPublicKeys(${newOwner}.hex(20)).call()); // address should be registered`;
}
else if (!stateNode.ownerIsSecret && !stateNode.ownerIsParam) {
newOwnerStatment = `_${privateStateName}_newOwnerPublicKey === 0 ? generalise(await instance.methods.zkpPublicKeys(await instance.methods.${newOwner}().call()).call()) : ${privateStateName}_newOwnerPublicKey;`;
} else if (stateNode.ownerIsParam && newOwner) {
newOwnerStatment = `_${privateStateName}_newOwnerPublicKey === 0 ? ${newOwner} : ${privateStateName}_newOwnerPublicKey;`;
Expand Down
13 changes: 5 additions & 8 deletions src/traverse/MappingKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,11 @@ export default class MappingKey {
updateOwnership(ownerNode: any) {
//We need to check if the owner node is msg.sender - if it is then we need to set the owner to the mapping key
if (this.container.owner.mappingOwnershipType === 'key'){
if (this.isOwned){
return;
} else {
this.isOwned =true;
this.owner = this.keyPath.node;
this.owner.mappingOwnershipType = 'key';
return;
}
this.isOwned =true;
this.owner = this.keyPath.node;
this.owner.mappingOwnershipType = 'key';
this.owner.isParam = this.keyPath.isFunctionParameter();
return;
}
if (this.isOwned && this.owner.mappingOwnershipType === 'key') return;
if (this.isOwned && this.owner.name !== ownerNode.name) {
Expand Down

0 comments on commit 6f33332

Please sign in to comment.