@@ -32,29 +32,30 @@ describe("E2E nodejs", () => {
3232
3333 // create client
3434 const endpoint = gammeDriver . getEndpoint ( ) ;
35- const client = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" ) ;
35+ console . log ( Orbs )
36+ const senderClient = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" , new Orbs . DefaultSigner ( sender ) ) ;
3637
3738 // create transfer transaction
38- const [ tx , txId ] = client . createTransaction ( sender . publicKey , sender . privateKey , "BenchmarkToken" , "transfer" , [ Orbs . argUint64 ( 10 ) , Orbs . argAddress ( receiver . address ) ] ) ;
39+ const [ tx , txId ] = senderClient . createTransaction ( "BenchmarkToken" , "transfer" , [ Orbs . argUint64 ( 10 ) , Orbs . argAddress ( receiver . address ) ] ) ;
3940
4041 // send the transaction
41- const transferResponse = await client . sendTransaction ( tx ) ;
42+ const transferResponse = await senderClient . sendTransaction ( tx ) ;
4243 console . log ( "Transfer response:" ) ;
4344 console . log ( transferResponse ) ;
4445 expect ( transferResponse . requestStatus ) . toEqual ( "COMPLETED" ) ;
4546 expect ( transferResponse . executionResult ) . toEqual ( "SUCCESS" ) ;
4647 expect ( transferResponse . transactionStatus ) . toEqual ( "COMMITTED" ) ;
4748
4849 // check the transaction status
49- const statusResponse = await client . getTransactionStatus ( txId ) ;
50+ const statusResponse = await senderClient . getTransactionStatus ( txId ) ;
5051 console . log ( "Status response:" ) ;
5152 console . log ( statusResponse ) ;
5253 expect ( statusResponse . requestStatus ) . toEqual ( "COMPLETED" ) ;
5354 expect ( statusResponse . executionResult ) . toEqual ( "SUCCESS" ) ;
5455 expect ( statusResponse . transactionStatus ) . toEqual ( "COMMITTED" ) ;
5556
5657 // check the transaction receipt proof
57- const txProofResponse = await client . getTransactionReceiptProof ( txId ) ;
58+ const txProofResponse = await senderClient . getTransactionReceiptProof ( txId ) ;
5859 console . log ( "Receipt proof response:" ) ;
5960 console . log ( txProofResponse ) ;
6061 expect ( txProofResponse . requestStatus ) . toEqual ( "COMPLETED" ) ;
@@ -64,18 +65,18 @@ describe("E2E nodejs", () => {
6465 expect ( txProofResponse . packedReceipt . byteLength ) . toBeGreaterThan ( 10 ) ;
6566
6667 // create balance query
67- const query = client . createQuery ( receiver . publicKey , "BenchmarkToken" , "getBalance" , [ Orbs . argAddress ( receiver . address ) ] ) ;
68+ const query = senderClient . createQuery ( "BenchmarkToken" , "getBalance" , [ Orbs . argAddress ( receiver . address ) ] ) ;
6869
6970 // send the query
70- const balanceResponse = await client . sendQuery ( query ) ;
71+ const balanceResponse = await senderClient . sendQuery ( query ) ;
7172 console . log ( "Query response:" ) ;
7273 console . log ( balanceResponse ) ;
7374 expect ( balanceResponse . requestStatus ) . toEqual ( "COMPLETED" ) ;
7475 expect ( balanceResponse . executionResult ) . toEqual ( "SUCCESS" ) ;
7576 expect ( balanceResponse . outputArguments [ 0 ] ) . toEqual ( Orbs . argUint64 ( 10 ) ) ;
7677
7778 // get the block which contains the transfer transaction
78- const blockResponse = await client . getBlock ( transferResponse . blockHeight ) ;
79+ const blockResponse = await senderClient . getBlock ( transferResponse . blockHeight ) ;
7980 expect ( blockResponse . blockHeight ) . toEqual ( transferResponse . blockHeight ) ;
8081 expect ( blockResponse . transactionsBlockHeader . blockHeight ) . toEqual ( transferResponse . blockHeight ) ;
8182 expect ( blockResponse . transactionsBlockHeader . numTransactions ) . toEqual ( 1 ) ;
@@ -91,7 +92,7 @@ describe("E2E nodejs", () => {
9192 test ( "TextualError" , async ( ) => {
9293 // create client
9394 const endpoint = gammeDriver . getEndpoint ( ) ;
94- const client = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" ) ;
95+ const client = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" , new Orbs . DefaultSigner ( Orbs . createAccount ( ) ) ) ;
9596
9697 // send a corrupt transaction
9798 let error ;
@@ -112,15 +113,15 @@ describe("E2E nodejs", () => {
112113
113114 // create client
114115 const endpoint = gammeDriver . getEndpoint ( ) ;
115- const client = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" ) ;
116+ const client = new Orbs . Client ( endpoint , VIRTUAL_CHAIN_ID , "TEST_NET" , new Orbs . DefaultSigner ( sender ) ) ;
116117
117118 const sources = [
118119 readFileSync ( `${ __dirname } /../contract/increment_base.go` ) ,
119120 readFileSync ( `${ __dirname } /../contract/increment_functions.go` )
120121 ] ;
121122
122123 // create transfer transaction
123- const [ deploymentTx , deploymentTxId ] = client . createDeployTransaction ( sender . publicKey , sender . privateKey , "Inc" , Orbs . PROCESSOR_TYPE_NATIVE , ...sources ) ;
124+ const [ deploymentTx , deploymentTxId ] = client . createDeployTransaction ( "Inc" , Orbs . PROCESSOR_TYPE_NATIVE , ...sources ) ;
124125
125126 // send the transaction
126127 const deploymentResponse = await client . sendTransaction ( deploymentTx ) ;
@@ -131,7 +132,7 @@ describe("E2E nodejs", () => {
131132 expect ( deploymentResponse . transactionStatus ) . toEqual ( "COMMITTED" ) ;
132133
133134 // create transfer transaction
134- const [ tx , txId ] = client . createTransaction ( sender . publicKey , sender . privateKey , "BenchmarkToken" , "transfer" , [ Orbs . argUint64 ( 10 ) , Orbs . argAddress ( receiver . address ) ] ) ;
135+ const [ tx , txId ] = client . createTransaction ( "BenchmarkToken" , "transfer" , [ Orbs . argUint64 ( 10 ) , Orbs . argAddress ( receiver . address ) ] ) ;
135136
136137 // send the transaction
137138 const transferResponse = await client . sendTransaction ( tx ) ;
@@ -142,7 +143,7 @@ describe("E2E nodejs", () => {
142143 expect ( transferResponse . transactionStatus ) . toEqual ( "COMMITTED" ) ;
143144
144145 // create balance query
145- const query = client . createQuery ( receiver . publicKey , "BenchmarkToken" , "getBalance" , [ Orbs . argAddress ( receiver . address ) ] ) ;
146+ const query = client . createQuery ( "BenchmarkToken" , "getBalance" , [ Orbs . argAddress ( receiver . address ) ] ) ;
146147
147148 // send the query
148149 const balanceResponse = await client . sendQuery ( query ) ;
0 commit comments