Skip to content

Commit

Permalink
fix: increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Nov 27, 2024
1 parent d7fd6db commit 027ebc1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions agglayer/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ func TestMGenericPPError(t *testing.T) {
require.Equal(t, "Generic error: test: value", err.String())
}

func TestCertificateHeaderID(t *testing.T) {
certificate := CertificateHeader{
Height: 1,
CertificateID: common.HexToHash("0x123"),
}
require.Equal(t, "1/0x0000000000000000000000000000000000000000000000000000000000000123", certificate.ID())

var certNil *CertificateHeader
require.Equal(t, "nil", certNil.ID())
}

func TestCertificateHeaderString(t *testing.T) {
certificate := CertificateHeader{
Height: 1,
CertificateID: common.HexToHash("0x123"),
}
require.Equal(t, "Height: 1, CertificateID: 0x0000000000000000000000000000000000000000000000000000000000000123, previousLocalExitRoot:nil, NewLocalExitRoot: 0x0000000000000000000000000000000000000000000000000000000000000000. Status: Pending. Errors: []",
certificate.String())

var certNil *CertificateHeader
require.Equal(t, "nil", certNil.String())
}

func TestMarshalJSON(t *testing.T) {
cert := SignedCertificate{
Certificate: &Certificate{
Expand Down

0 comments on commit 027ebc1

Please sign in to comment.