diff --git a/access/grpc/convert/convert.go b/access/grpc/convert/convert.go index ea8a1eaa6..b93003231 100644 --- a/access/grpc/convert/convert.go +++ b/access/grpc/convert/convert.go @@ -268,9 +268,9 @@ func MessageToBlockHeader(m *entities.BlockHeader) (flow.BlockHeader, error) { timestamp = m.GetTimestamp().AsTime() } - tc, err := MessageToTimeoutCertificate(m.GetLastViewTc()) + timeoutCertificate, err := MessageToTimeoutCertificate(m.GetLastViewTc()) if err != nil { - return flow.BlockHeader{}, err + return flow.BlockHeader{}, fmt.Errorf("error converting timeout certificate: %w", err) } return flow.BlockHeader{ @@ -285,19 +285,20 @@ func MessageToBlockHeader(m *entities.BlockHeader) (flow.BlockHeader, error) { ProposerSigData: m.GetProposerSigData(), ChainID: flow.HashToID([]byte(m.GetChainId())), ParentVoterIndices: m.GetParentVoterIndices(), - LastViewTimeoutCertificate: tc, + LastViewTimeoutCertificate: timeoutCertificate, ParentView: m.GetParentView(), }, nil } func MessageToTimeoutCertificate(m *entities.TimeoutCertificate) (flow.TimeoutCertificate, error) { if m == nil { - return flow.TimeoutCertificate{}, ErrEmptyMessage + // timeout certificate can be nil + return flow.TimeoutCertificate{}, nil } qc, err := MessageToQuorumCertificate(m.GetHighestQc()) if err != nil { - return flow.TimeoutCertificate{}, err + return flow.TimeoutCertificate{}, fmt.Errorf("error converting quorum certificate: %w", err) } return flow.TimeoutCertificate{ @@ -326,7 +327,7 @@ func TimeoutCertificateToMessage(tc flow.TimeoutCertificate) (*entities.TimeoutC func MessageToQuorumCertificate(m *entities.QuorumCertificate) (flow.QuorumCertificate, error) { if m == nil { - return flow.QuorumCertificate{}, ErrEmptyMessage + return flow.QuorumCertificate{}, fmt.Errorf("quourum certificate is empty: %w", ErrEmptyMessage) } return flow.QuorumCertificate{ diff --git a/examples/go.mod b/examples/go.mod index c58c5e374..25d222804 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.4 replace github.com/onflow/flow-go-sdk => ../ require ( - github.com/onflow/cadence v1.0.1-0.20241018173327-2e72919b18ac + github.com/onflow/cadence v1.2.1 github.com/onflow/flow-cli/flowkit v1.11.0 github.com/onflow/flow-go-sdk v0.41.17 github.com/spf13/afero v1.11.0 diff --git a/examples/go.sum b/examples/go.sum index 6ef27de99..e80f1bdfe 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -120,6 +120,7 @@ github.com/onflow/cadence v1.0.0-preview.38/go.mod h1:jOwvPSSLTr9TvaKMs7KKiBYMmp github.com/onflow/cadence v1.0.0-preview.52/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/cadence v1.0.0/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU= github.com/onflow/cadence v1.0.1-0.20241018173327-2e72919b18ac/go.mod h1:fJxxOAp1wnWDfOHT8GOc1ypsU0RR5E3z51AhG8Yf5jg= +github.com/onflow/cadence v1.2.1/go.mod h1:fJxxOAp1wnWDfOHT8GOc1ypsU0RR5E3z51AhG8Yf5jg= github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=