@@ -23,6 +23,7 @@ import { validators } from "../../../tendermint.dynval/constants";
2323import { faucetAddress , faucetSecret } from "../../helper/constants" ;
2424import { PromiseExpect } from "../../helper/promise" ;
2525import { findNode , setTermTestTimeout , withNodes } from "../setup" ;
26+ import { H256 } from "codechain-primitives/lib" ;
2627
2728describe ( "Dynamic Validator N -> N+1" , function ( ) {
2829 const promiseExpect = new PromiseExpect ( ) ;
@@ -99,13 +100,13 @@ describe("Dynamic Validator N -> N+1", function() {
99100 )
100101 . sign ( {
101102 secret : betty . privateKey ,
102- seq : await bettyNode . testFramework . rpc . chain . getSeq (
103- betty . platformAddress
104- ) ,
103+ seq : ( await bettyNode . rpc . chain . getSeq ( {
104+ address : betty . platformAddress . toString ( )
105+ } ) ) ! ,
105106 fee : 10
106107 } ) ;
107- const nominateTxHash = bettyNode . testFramework . rpc . chain . sendSignedTransaction (
108- nominateTx
108+ const nominateTxHash = await bettyNode . rpc . mempool . sendSignedTransaction (
109+ { tx : nominateTx . rlpBytes ( ) . toString ( "hex" ) }
109110 ) ;
110111 const delegateTx = stake
111112 . createDelegateCCSTransaction (
@@ -115,15 +116,18 @@ describe("Dynamic Validator N -> N+1", function() {
115116 )
116117 . sign ( {
117118 secret : faucetSecret ,
118- seq : await bettyNode . testFramework . rpc . chain . getSeq (
119- faucetAddress
120- ) ,
119+ seq : ( await bettyNode . rpc . chain . getSeq ( {
120+ address : faucetAddress . toString ( )
121+ } ) ) ! ,
121122 fee : 10
122123 } ) ;
123- const delegateTxHash = bettyNode . testFramework . rpc . chain . sendSignedTransaction (
124- delegateTx
124+ const delegateTxHash = await bettyNode . rpc . mempool . sendSignedTransaction (
125+ { tx : delegateTx . rlpBytes ( ) . toString ( "hex" ) }
125126 ) ;
126- await checkingNode . waitForTx ( [ nominateTxHash , delegateTxHash ] ) ;
127+ await checkingNode . waitForTx ( [
128+ new H256 ( nominateTxHash ) ,
129+ new H256 ( delegateTxHash )
130+ ] ) ;
127131
128132 await termWaiter . waitNodeUntilTerm ( checkingNode , {
129133 target : 2 ,
@@ -161,15 +165,15 @@ describe("Dynamic Validator N -> N+1", function() {
161165 )
162166 . sign ( {
163167 secret : betty . privateKey ,
164- seq : await checkingNode . testFramework . rpc . chain . getSeq (
165- betty . platformAddress
166- ) ,
168+ seq : ( await checkingNode . rpc . chain . getSeq ( {
169+ address : betty . platformAddress . toString ( )
170+ } ) ) ! ,
167171 fee : 10
168172 } ) ;
169- const nominateTxHash = checkingNode . testFramework . rpc . chain . sendSignedTransaction (
170- nominateTx
173+ const nominateTxHash = await checkingNode . rpc . mempool . sendSignedTransaction (
174+ { tx : nominateTx . rlpBytes ( ) . toString ( "hex" ) }
171175 ) ;
172- await checkingNode . waitForTx ( nominateTxHash ) ;
176+ await checkingNode . waitForTx ( new H256 ( nominateTxHash ) ) ;
173177
174178 await termWaiter . waitNodeUntilTerm ( checkingNode , {
175179 target : 2 ,
@@ -199,9 +203,9 @@ describe("Dynamic Validator N -> N+1", function() {
199203
200204 const checkingNode = nodes [ 0 ] ;
201205 await beforeInsertionCheck ( checkingNode . rpc ) ;
202- const faucetSeq = await checkingNode . testFramework . rpc . chain . getSeq (
203- faucetAddress
204- ) ;
206+ const faucetSeq = ( await checkingNode . rpc . chain . getSeq ( {
207+ address : faucetAddress . toString ( )
208+ } ) ) ! ;
205209 const delegateTx = stake
206210 . createDelegateCCSTransaction (
207211 checkingNode . testFramework ,
@@ -213,10 +217,10 @@ describe("Dynamic Validator N -> N+1", function() {
213217 seq : faucetSeq ,
214218 fee : 10
215219 } ) ;
216- const delegateTxHash = checkingNode . testFramework . rpc . chain . sendSignedTransaction (
217- delegateTx
220+ const delegateTxHash = await checkingNode . rpc . mempool . sendSignedTransaction (
221+ { tx : delegateTx . rlpBytes ( ) . toString ( "hex" ) }
218222 ) ;
219- await checkingNode . waitForTx ( delegateTxHash ) ;
223+ await checkingNode . waitForTx ( new H256 ( delegateTxHash ) ) ;
220224
221225 await termWaiter . waitNodeUntilTerm ( checkingNode , {
222226 target : 2 ,
0 commit comments