feat: invoke fromDebug in NodePortal.html

This commit is contained in:
root
2021-06-16 12:11:09 +08:00
parent 0b16ec99cd
commit 900413f0e4
5 changed files with 44 additions and 19 deletions

View File

@@ -35,6 +35,9 @@ var onListContractProcess1 = function(obj) {
global.permissionNameMap = {};
for (var i = 0; i < table.length; i++) {
if (table[i].contractStatus=="KILLED") {
continue;
}
var option = document.createElement("option");
option.text = table[i].name;
console.log(table[i].name);
@@ -370,6 +373,7 @@ var executeContractWithDynamicResult = function() {
request.contractName = global.contractInstance;
request.sequencing = global.instanceSequencing;
request.useP2P = global.useP2P;
request.isDebug = executeContractAsDebug.checked;
var operation = $("#selectContractFunction")[0].value;
if (operation == " " && operation == undefined) {
myToast("执行合约", "请选择合约方法!");
@@ -399,6 +403,7 @@ var executeContract = function() {
request.operation = operation;
request.arg = $("#arg")[0].value ;
request.pubkey = global.sm2Key.publicKey;
request.isDebug = executeContractAsDebug.checked;
console.log(request.arg);
request.signature = sm2.doSignature(request.contractID + "|" + operation
+ "|" + $("#arg")[0].value + "|" + global.sm2Key.publicKey,

View File

@@ -207,9 +207,11 @@ function initGlobal(urlParams) {
global.isBaaS = true
primaryColor = "#08263a"
}
if (urlParams){
global.urlparam = urlParams;
}
if (urlParams && urlParams.keys) {
global.urlparam = urlParams
global.sm2Key = urlParams.keys
global.sm2Key = urlParams.keys;
} else {
global.sm2Key = localStorage.getItem("PrivKey");
if (!global.sm2Key || global.sm2Key.length < 100) {

View File

@@ -235,6 +235,7 @@ var executeContract = function () {
}
// console.log("[arg.gasLimit]"+arg.gasLimit);
request.pubkey = sm2Key.publicKey;
// request.isDebug = executeContractAsDebug.checked;
request.signature = sm2.doSignature(request.contractID + "|" + arg.action
+ "|" + arg.arg + "|" + sm2Key.publicKey, sm2Key.privateKey, {hash: true, der: true});
request.arg = JSON.stringify(arg);