activates test

This commit is contained in:
andri lim 2019-08-29 19:57:01 +07:00
parent 54b56ca722
commit 230fb4b06d
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 20 additions and 14 deletions

View File

@ -24,15 +24,15 @@ OK: 8/8 Fail: 0/8 Skip: 0/8
```diff
+ NotEnoughGasLimit.json OK
+ TransactionWithGasLimitOverflow.json OK
+ TransactionWithGasLimitOverflow2.json OK
+ TransactionWithGasLimitOverflow63.json OK
+ TransactionWithGasLimitOverflow63_1.json OK
- TransactionWithGasLimitOverflow2.json Fail
- TransactionWithGasLimitOverflow63.json Fail
- TransactionWithGasLimitOverflow63_1.json Fail
+ TransactionWithGasLimitxPriceOverflow.json OK
+ TransactionWithGasLimitxPriceOverflow2.json OK
+ TransactionWithHighGas.json OK
+ TransactionWithHihghGasLimit63m1.json OK
```
OK: 9/9 Fail: 0/9 Skip: 0/9
OK: 6/9 Fail: 3/9 Skip: 0/9
## ttGasPrice
```diff
+ TransactionWithGasPriceOverflow.json OK
@ -221,4 +221,4 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
OK: 70/70 Fail: 0/70 Skip: 0/70
---TOTAL---
OK: 179/179 Fail: 0/179 Skip: 0/179
OK: 176/179 Fail: 3/179 Skip: 0/179

View File

@ -29,13 +29,6 @@ proc intrinsicGas*(tx: Transaction, fork: Fork): GasInt =
if tx.isContractCreation:
result = result + gasFees[fork][GasTXCreate]
proc validate*(t: Transaction, fork: Fork) =
# Hook called during instantiation to ensure that all transaction
# parameters pass validation rules
if t.intrinsicGas(fork) > t.gasLimit:
raise newException(ValidationError, "Insufficient gas")
# self.check_signature_validity()
proc getSignature*(transaction: Transaction, output: var Signature): bool =
var bytes: array[65, byte]
bytes[0..31] = transaction.R.toByteArrayBE()
@ -55,7 +48,7 @@ proc getSignature*(transaction: Transaction, output: var Signature): bool =
proc toSignature*(transaction: Transaction): Signature =
if not getSignature(transaction, result):
raise newException(Exception, "Invalid signaure")
raise newException(Exception, "Invalid signature")
proc getSender*(transaction: Transaction, output: var EthAddress): bool =
## Find the address the transaction was sent from.
@ -78,3 +71,15 @@ proc getRecipient*(tx: Transaction): EthAddress =
result = generateAddress(sender, tx.accountNonce)
else:
result = tx.to
proc validate*(tx: Transaction, fork: Fork) =
# Hook called during instantiation to ensure that all transaction
# parameters pass validation rules
if tx.intrinsicGas(fork) > tx.gasLimit:
raise newException(ValidationError, "Insufficient gas")
# check signature validity
var sender: EthAddress
if not tx.getSender(sender):
raise newException(ValidationError, "Invalid signature or failed message verification")

View File

@ -23,5 +23,6 @@ import ./test_code_stream,
./test_op_misc,
./test_op_custom,
./test_state_db,
./test_difficulty
./test_difficulty,
./test_transaction_json