Skip to content

Commit 4fb104d

Browse files
committed
test code
1 parent 7007408 commit 4fb104d

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

src/smartContract.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,11 @@ function getNewDeployCtrAddr(chainSQL, txHash){
920920
}
921921

922922
function calculateCtrAddr(ctrOwnerAddr, sequence){
923+
<<<<<<< Updated upstream
923924
let hexAddrStr = chainsqlUtils.decodeChainsqlAddr(ctrOwnerAddr).toUpperCase();
925+
=======
926+
let hexAddrStr = decodeChainsqlAddr(ctrOwnerAddr);
927+
>>>>>>> Stashed changes
924928
let hexSeqStr = dec2FixLenHex(sequence, 2*4);
925929
let hexFinalStr = hexAddrStr + hexSeqStr;
926930
return keypairs.deriveAddress(hexFinalStr);

test/smartContractTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ main();
1818

1919
async function main(){
2020
try {
21-
await chainsql.connect("ws://127.0.0.1:5215");
21+
await chainsql.connect("ws://127.0.0.1:6007");
2222
console.log("connected successfully");
2323

2424
chainsql.as(RootUser);

test/test.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var issuer = {
2626
// }
2727

2828

29-
var sTableName = "a2";
29+
var sTableName = "a5";
3030
var sTableName2 = "b1";
3131
var sReName = "boy1234";
3232
var sTableName3 = "hijack12";
@@ -43,13 +43,17 @@ async function main(){
4343

4444
// c.setRestrict(true);
4545
//激活user账户
46+
<<<<<<< Updated upstream
4647
// await activateAccount(user.address);
48+
=======
49+
// await activateAccount(user.address);
50+
>>>>>>> Stashed changes
4751

4852
//await testSubscribe();
4953

5054
// await testRippleAPI();
5155
// await testAccount();
52-
// await testChainsql();
56+
await testChainsql();
5357

5458
//await c.disconnect();
5559
console.log('运行结束')
@@ -137,7 +141,7 @@ async function testAccount(){
137141
}
138142

139143
async function testChainsql(){
140-
// await testCreateTable();
144+
await testCreateTable();
141145

142146
// // //创建另一张表,用来测试rename,drop
143147
// await testCreateTable1();
@@ -151,8 +155,12 @@ async function testChainsql(){
151155
// await testTxs();
152156
// await insertAfterGrant();
153157
// await testOperationRule();
158+
<<<<<<< Updated upstream
154159
await testAccountTables();
155160
await testTableAuth();
161+
=======
162+
//await testAccountTables();
163+
>>>>>>> Stashed changes
156164

157165
//现在底层不允许直接删除所有记录这种操作了
158166
// await testDeleteAll();
@@ -186,7 +194,7 @@ function unsubTable(tb, owner) {
186194
var testCreateTable = async function() {
187195
var raw = [
188196
{'field':'id','type':'int','length':11,'PK':1,'NN':1},
189-
{'field':'name','type':'varchar','length':50,'default':null},
197+
{'field':'name','type':'varchar','length':50,'default':""},
190198
{'field':'age','type':'int'}
191199
]
192200
var option = {

test/testContractTableTxs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ async function main() {
6969

7070
/**************************************/
7171
// userOperation = user;
72-
const contractAddr = "z97GFzn3pLPPq9iFFda2mMmB94LZrZmZfp";
73-
let nStep = tagStep.deployContract;
72+
const contractAddr = "zccYXdYmuk78c9iNQdayvsevhosQjkWBJG";
73+
let nStep = tagStep.table_insert;
7474
// sTableName = sTableNameNew;
7575
//
7676
if (nStep != tagStep.active && nStep != tagStep.deployContract) {

0 commit comments

Comments
 (0)