Search in sources :

Example 1 with ContractInfo

use of org.aion.precompiled.ContractInfo in project aion by aionnetwork.

the class TXValidatorTest method validateTxSignatureSwapForkEnabledReceiverAddressIsPreCompiledTest.

@Test
public void validateTxSignatureSwapForkEnabledReceiverAddressIsPreCompiledTest() {
    boolean signatureSwapEnabled = true;
    for (ContractInfo contractInfo : ContractInfo.values()) {
        AionTransaction tx = AionTransaction.create(key, nonce, contractInfo.contractAddress, value, data, nrg, nrgPrice, type, null);
        TxResponse response = TXValidator.validateTx(tx, unityForkEnabled, signatureSwapEnabled);
        // Note: TOTAL CURRENCY contract has been disabled.
        if (contractInfo.contractAddress.equals(ContractInfo.TOTAL_CURRENCY.contractAddress)) {
            assertEquals(TxResponse.INVALID_TX_DESTINATION, response);
        } else {
            assertEquals(TxResponse.SUCCESS, response);
        }
    }
}
Also used : ContractInfo(org.aion.precompiled.ContractInfo) AionTransaction(org.aion.base.AionTransaction) TxResponse(org.aion.zero.impl.types.TxResponse) Test(org.junit.Test)

Aggregations

AionTransaction (org.aion.base.AionTransaction)1 ContractInfo (org.aion.precompiled.ContractInfo)1 TxResponse (org.aion.zero.impl.types.TxResponse)1 Test (org.junit.Test)1