import ZKWormholeEdge from "./ZKWormholeEdge.js";
import WarpError from "../../errors/WarpError.js";
/** Rejected transition-proof verification for a cold wormhole edge. */
export default class RejectedZKWormhole {
    edge;
    reason;
    constructor(edge, reason) {
        if (!(edge instanceof ZKWormholeEdge)) {
            throw new WarpError('edge must be a ZKWormholeEdge', 'E_VALIDATION');
        }
        this.edge = edge;
        this.reason = requireNonEmptyString(reason, 'reason');
        Object.freeze(this);
    }
}
function requireNonEmptyString(value, name) {
    if (typeof value !== 'string' || value.length === 0) {
        throw new WarpError(`${name} must be a non-empty string`, 'E_VALIDATION');
    }
    return value;
}
