mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-02 11:48:10 +08:00
以前没有删除,现在确认删除scripts目录。
This commit is contained in:
parent
24da6544aa
commit
aa7a99f3b2
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
function loadCert(cert){
|
||||
shim.loadCert(cert);
|
||||
print("cert:"+cert);
|
||||
}
|
||||
function write(pn,pv){
|
||||
shim.setVal(pn,pv);
|
||||
// print("setState:"+pn+":"+pv)
|
||||
}
|
||||
function set(pm){
|
||||
for(x in pm){
|
||||
write(x,pm[x]);
|
||||
}
|
||||
}
|
||||
function read(pn){
|
||||
return shim.getVal(pn);
|
||||
}
|
||||
function transfer(afrom,ato,amount){
|
||||
// print('tx_account:'+tx_account);
|
||||
if(afrom != tx_account)
|
||||
throw "["+tx_account+"]无权从["+afrom+"]转出资产"
|
||||
var rfrom = read(afrom);
|
||||
// print(rfrom + ":" + amount)
|
||||
if(rfrom<amount)
|
||||
throw "余额不足!"
|
||||
var rto = read(ato);
|
||||
write(afrom,rfrom-amount);
|
||||
write(ato,rto+amount);
|
||||
// print(ato+':'+read(ato))
|
||||
}
|
||||
|
||||
function put_proof(pn,pv){
|
||||
//先检查该hash是否已经存在,如果已存在,抛异常
|
||||
var pv0 = read(pn);
|
||||
if(pv0)
|
||||
throw '['+pn+']已存在,当前值['+pv0+']';
|
||||
shim.setVal(pn,pv);
|
||||
print('putProof:'+pn+':'+pv);
|
||||
}
|
||||
function signup(cert,inf){
|
||||
shim.check(tx_account,tx)
|
||||
return shim.signup(cert,inf);
|
||||
}
|
||||
|
||||
function destroyCert(certAddr){
|
||||
shim.check(tx_account,tx)
|
||||
shim.destroyCert(certAddr);
|
||||
}
|
||||
|
||||
function replaceCert(pemCert,certAddr){
|
||||
shim.check(tx_account,tx)
|
||||
return shim.replaceCert(pemCert,certAddr);
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
set({
|
||||
'1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN':1000000,
|
||||
'12kAzqqhuq7xYgm9YTph1b9zmCpZPyUWxf':1000000,
|
||||
'1GvvHCFZPajq5yVY44n7bdmSfv2MJ5LyLs':1000000,
|
||||
'1AqZs6vhcLiiTvFxqS5CEqMw6xWuX9xqyi':1000000,
|
||||
'16SrzMbzdLyGEUKY5FsdE8SVt5tQV1qmBY':1000000,
|
||||
});
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
print("addr_self:"+addr_self);
|
||||
transfer('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN','12kAzqqhuq7xYgm9YTph1b9zmCpZPyUWxf',5);
|
||||
read('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN');
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
print("addr_self:"+addr_self);
|
||||
transfer('12kAzqqhuq7xYgm9YTph1b9zmCpZPyUWxf','1GvvHCFZPajq5yVY44n7bdmSfv2MJ5LyLs',5);
|
||||
read('12kAzqqhuq7xYgm9YTph1b9zmCpZPyUWxf');
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
print("addr_self:"+addr_self);
|
||||
transfer('1GvvHCFZPajq5yVY44n7bdmSfv2MJ5LyLs','1AqZs6vhcLiiTvFxqS5CEqMw6xWuX9xqyi',5);
|
||||
read('1GvvHCFZPajq5yVY44n7bdmSfv2MJ5LyLs');
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
print("addr_self:"+addr_self);
|
||||
transfer('1AqZs6vhcLiiTvFxqS5CEqMw6xWuX9xqyi','16SrzMbzdLyGEUKY5FsdE8SVt5tQV1qmBY',5);
|
||||
read('1AqZs6vhcLiiTvFxqS5CEqMw6xWuX9xqyi');
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
print("addr_self:"+addr_self);
|
||||
transfer('16SrzMbzdLyGEUKY5FsdE8SVt5tQV1qmBY','1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN',5);
|
||||
read('16SrzMbzdLyGEUKY5FsdE8SVt5tQV1qmBY');
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
function write(pn,pv){
|
||||
shim.setVal(pn,pv);
|
||||
}
|
||||
function read(pn){
|
||||
return shim.getVal(pn);
|
||||
}
|
||||
|
||||
function put_proof(pn,pv){
|
||||
//先检查该hash是否已经存在,如果已存在,抛异常
|
||||
var pv0 = read(pn);
|
||||
// if(pv0)
|
||||
// throw '['+pn+']已存在,当前值['+pv0+']';
|
||||
shim.setVal(pn,pv);
|
||||
print('putProof:'+pn+':'+pv);
|
||||
}
|
||||
function signup(cert,inf){
|
||||
return shim.signup(cert,inf);
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
put_proof('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN','json content');
|
||||
read('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN');
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
put_proof('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN44','json content');
|
||||
read('1MH9xedPTkWThJUgT8ZYehiGCM7bEZTVGN44');
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Blockchain Technology and Application Joint Lab, Linkel Technology Co., Ltd, Beijing, Fintech Research Center of ISCAS.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BA SIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
signup('rO0ABXNyAC1qYXZhLnNlY3VyaXR5LmNlcnQuQ2VydGlmaWNhdGUkQ2VydGlmaWNhdGVSZXCJJ2qdya48DAIAAlsABGRhdGF0AAJbQkwABHR5cGV0ABJMamF2YS9sYW5nL1N0cmluZzt4cHVyAAJbQqzzF/gGCFTgAgAAeHAAAAGeMIIBmjCCAT+gAwIBAgIEWWV+AzAKBggqhkjOPQQDAjBWMQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxCzAJBgNVBAcMAmJqMREwDwYDVQQKDAhyZXBjaGFpbjEOMAwGA1UECwwFaXNjYXMxCjAIBgNVBAMMATEwHhcNMTcwNzEyMDE0MjE1WhcNMTgwNzEyMDE0MjE1WjBWMQswCQYDVQQGEwJjbjELMAkGA1UECAwCYmoxCzAJBgNVBAcMAmJqMREwDwYDVQQKDAhyZXBjaGFpbjEOMAwGA1UECwwFaXNjYXMxCjAIBgNVBAMMATEwVjAQBgcqhkjOPQIBBgUrgQQACgNCAAT6VLE/eF9+sK1ROn8n6x7hKsBxehW42qf1IB8quBn5OrQD3x2H4yZVDwPgcEUCjH8PcFgswdtbo8JL/7f66yECMAoGCCqGSM49BAMCA0kAMEYCIQCud+4/3njnfUkG9ffSqcHhnsuZNMQwaW62EVXbcjoiBgIhAPoLJK1D06IMoholYcsgTQb5Trrej/erZONMm1cS1iP+dAAFWC41MDk=',
|
||||
'{a:"v1",b:"v2"}');
|
Loading…
Reference in New Issue
Block a user