Skip to content

Commit

Permalink
fix: merge error & add security status & action reload to STS viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Nov 9, 2023
1 parent f3947b3 commit 997eb73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascript/engine-js/src/tokenScript/Origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export class Origin {
// const dsigKeyOrAddress = contractKey.valueType === "ethAddress" ? ethers.utils.computeAddress(publicKeyHex) : publicKeyHex;

const dSigAddress = ethers.utils.computeAddress(publicKeyHex);

// TODO: Check signer key as well as authoritative key
const isAdmin = await (new ContractKeyResolver(this.tokenScript).isAdmin(contract, dSigAddress));

// console.log("DSIG validator: revolved contract deployment key: ", contractKey);
Expand All @@ -87,7 +89,7 @@ export class Origin {
console.warn(`DSIG validator: contract key does not match DSIG( publicKeyHex: ${publicKeyHex}, address: ${dSigAddress})`);
}

this.signingKey = contractKey.value;
this.signingKey = dSigAddress;

} catch (e) {
console.warn(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ export class SmartTokenStoreViewer {
tokenScript.setCurrentTokenContext(selectedOrigin.originId, 0);
this.tokenScript = tokenScript;

// Reload cards after the token is updated
this.tokenScript.on("TOKENS_UPDATED", (data) => {
this.cardButtons = null;
this.overflowCardButtons = null;
this.loadCards();
}, "grid")

this.loadCards();
}

Expand Down Expand Up @@ -285,6 +292,9 @@ export class SmartTokenStoreViewer {
] : ''
}
</div>
<div style={{padding: "0 10px"}}>
{this.tokenScript ? <security-status tokenScript={this.tokenScript}/> : ''}
</div>
</div>
) : '' }
</div>
Expand Down

0 comments on commit 997eb73

Please sign in to comment.