@@ -30,7 +30,6 @@ describe('VET Staking Transaction', function () {
3030 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
3131 txBuilder . amountToStake ( amountToStake ) ;
3232 txBuilder . levelId ( levelId ) ;
33- txBuilder . stakingContractABI ( EthereumAbi ) ;
3433 txBuilder . sender ( '0x9378c12BD7502A11F770a5C1F223c959B2805dA9' ) ;
3534 txBuilder . chainTag ( 0x27 ) ; // Testnet chain tag
3635 txBuilder . blockRef ( '0x0000000000000000' ) ;
@@ -49,7 +48,6 @@ describe('VET Staking Transaction', function () {
4948 stakingTx . amountToStake . should . equal ( amountToStake ) ;
5049 stakingTx . levelId . should . equal ( levelId ) ;
5150 stakingTx . autorenew . should . equal ( autorenew ) ;
52- stakingTx . stakingContractABI . should . deepEqual ( EthereumAbi ) ;
5351
5452 // Verify clauses
5553 stakingTx . clauses . length . should . equal ( 1 ) ;
@@ -84,7 +82,6 @@ describe('VET Staking Transaction', function () {
8482 const txBuilder = createBasicTxBuilder ( ) ;
8583 txBuilder . amountToStake ( amountToStake ) ;
8684 txBuilder . levelId ( levelId ) ;
87- txBuilder . stakingContractABI ( EthereumAbi ) ;
8885
8986 await txBuilder . build ( ) . should . be . rejectedWith ( 'Staking contract address is required' ) ;
9087 } ) ;
@@ -93,7 +90,6 @@ describe('VET Staking Transaction', function () {
9390 const txBuilder = createBasicTxBuilder ( ) ;
9491 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
9592 txBuilder . amountToStake ( amountToStake ) ;
96- txBuilder . stakingContractABI ( EthereumAbi ) ;
9793
9894 await txBuilder . build ( ) . should . be . rejectedWith ( 'Level ID is required' ) ;
9995 } ) ;
@@ -102,7 +98,6 @@ describe('VET Staking Transaction', function () {
10298 const txBuilder = createBasicTxBuilder ( ) ;
10399 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
104100 txBuilder . levelId ( levelId ) ;
105- txBuilder . stakingContractABI ( EthereumAbi ) ;
106101
107102 await txBuilder . build ( ) . should . be . rejectedWith ( 'Amount to stake is required' ) ;
108103 } ) ;
@@ -120,7 +115,6 @@ describe('VET Staking Transaction', function () {
120115 const txBuilder = createBasicTxBuilder ( ) ;
121116 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
122117 txBuilder . levelId ( levelId ) ;
123- txBuilder . stakingContractABI ( EthereumAbi ) ;
124118
125119 // Invalid amount (not a number)
126120 txBuilder . amountToStake ( 'not-a-number' ) ;
@@ -129,33 +123,10 @@ describe('VET Staking Transaction', function () {
129123 await txBuilder . build ( ) . should . be . rejected ( ) ;
130124 } ) ;
131125
132- it ( 'should pass validation with any ABI object but may fail during build' , async function ( ) {
133- const txBuilder = createBasicTxBuilder ( ) ;
134- txBuilder . stakingContractAddress ( stakingContractAddress ) ;
135- txBuilder . amountToStake ( amountToStake ) ;
136- txBuilder . levelId ( levelId ) ;
137-
138- // Set an invalid ABI object
139- const invalidAbi = { } ;
140- txBuilder . stakingContractABI ( invalidAbi as EthereumAbi ) ;
141-
142- // The validation will pass because it only checks if the ABI property exists
143- // But the build might fail if the ABI is actually used in the build process
144- // Since the actual encoding is done by utils.getStakingData() which doesn't use
145- // the ABI set on the transaction, this might still succeed
146- try {
147- await txBuilder . build ( ) ;
148- } catch ( e ) {
149- // If it fails, it should be because of an invalid ABI
150- e . message . should . match ( / m e t h o d I D | r a w E n c o d e / ) ;
151- }
152- } ) ;
153-
154126 it ( 'should allow zero amountToStake but encode it properly' , async function ( ) {
155127 const txBuilder = createBasicTxBuilder ( ) ;
156128 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
157129 txBuilder . levelId ( levelId ) ;
158- txBuilder . stakingContractABI ( EthereumAbi ) ;
159130 txBuilder . amountToStake ( '0' ) ;
160131
161132 const tx = await txBuilder . build ( ) ;
@@ -188,7 +159,6 @@ describe('VET Staking Transaction', function () {
188159 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
189160 txBuilder . amountToStake ( amountToStake ) ;
190161 txBuilder . levelId ( levelId ) ;
191- txBuilder . stakingContractABI ( EthereumAbi ) ;
192162 txBuilder . chainTag ( 0x27 ) ;
193163 txBuilder . blockRef ( '0x0000000000000000' ) ;
194164 txBuilder . expiration ( 64 ) ;
@@ -216,7 +186,6 @@ describe('VET Staking Transaction', function () {
216186 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
217187 txBuilder . amountToStake ( amountToStake ) ;
218188 txBuilder . levelId ( levelId ) ;
219- txBuilder . stakingContractABI ( EthereumAbi ) ;
220189 // Not setting chainTag
221190 txBuilder . blockRef ( '0x0000000000000000' ) ;
222191 txBuilder . expiration ( 64 ) ;
@@ -237,7 +206,6 @@ describe('VET Staking Transaction', function () {
237206 const txBuilder = createBasicTxBuilder ( ) ;
238207 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
239208 txBuilder . levelId ( levelId ) ;
240- txBuilder . stakingContractABI ( EthereumAbi ) ;
241209
242210 // Test with a different amount
243211 const differentAmount = '500000000000000000' ; // 0.5 VET
@@ -264,7 +232,6 @@ describe('VET Staking Transaction', function () {
264232 const txBuilder = createBasicTxBuilder ( ) ;
265233 txBuilder . stakingContractAddress ( stakingContractAddress ) ;
266234 txBuilder . levelId ( levelId ) ;
267- txBuilder . stakingContractABI ( EthereumAbi ) ;
268235
269236 // Test with a very large amount (near uint256 max)
270237 const largeAmount = '115792089237316195423570985008687907853269984665640564039457584007913129639935' ; // 2^256 - 1
0 commit comments