Search in sources :

Example 6 with SignedArtifacts

use of dsl.SignedArtifacts in project web3signer by ConsenSys.

the class InterchangeImportBadLogicalContentIntegrationTestBase method genesisValidatorRootConflictsWithExistingDbGvr.

@Test
void genesisValidatorRootConflictsWithExistingDbGvr() throws JsonProcessingException {
    insertGvr(Bytes32.ZERO);
    final InterchangeV5Format interchangeData = new InterchangeV5Format(new Metadata("5", Bytes32.leftPad(Bytes.fromHexString("0x123456"))), List.of(new SignedArtifacts("0x12345678", emptyList(), emptyList())));
    final byte[] jsonInput = mapper.writeValueAsBytes(interchangeData);
    assertThatThrownBy(() -> slashingProtectionContext.getSlashingProtection().importData(new ByteArrayInputStream(jsonInput))).isInstanceOf(RuntimeException.class).hasMessage("Failed to import database content");
    assertDbIsEmpty(jdbi);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InterchangeV5Format(dsl.InterchangeV5Format) SignedArtifacts(dsl.SignedArtifacts) Metadata(tech.pegasys.web3signer.slashingprotection.interchange.model.Metadata) Test(org.junit.jupiter.api.Test)

Aggregations

InterchangeV5Format (dsl.InterchangeV5Format)6 SignedArtifacts (dsl.SignedArtifacts)6 Test (org.junit.jupiter.api.Test)6 SignedAttestation (tech.pegasys.web3signer.slashingprotection.interchange.model.SignedAttestation)3 SignedBlock (tech.pegasys.web3signer.slashingprotection.interchange.model.SignedBlock)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 Path (java.nio.file.Path)2 Bytes (org.apache.tuweni.bytes.Bytes)2 Bytes32 (org.apache.tuweni.bytes.Bytes32)2 Signer (tech.pegasys.web3signer.dsl.signer.Signer)2 SignerConfigurationBuilder (tech.pegasys.web3signer.dsl.signer.SignerConfigurationBuilder)2 Metadata (tech.pegasys.web3signer.slashingprotection.interchange.model.Metadata)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Response (io.restassured.response.Response)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 OutputStream (java.io.OutputStream)1 Map (java.util.Map)1 Jdbi (org.jdbi.v3.core.Jdbi)1 Eth2SigningRequestBody (tech.pegasys.web3signer.core.service.http.handlers.signing.eth2.Eth2SigningRequestBody)1