class MqttMessenger{

};

class BallotVoter{
    constructor(onVote, messenger, host) {
        // Not using a configuration file.
        this.messenger = messenger;
        this.host = host;
        this.swarm = "swarm";
        
    };

    onConnect(){
        console.log("Connected");
        // Send a connected message to the swarm.
    };

    onMessage(message){
        print("Message Received");
        // Unpack the message.
        messageb = message.payloadBytes;
        var messageD = msgpack.decode(message.payloadBytes)
        console.log(messageD)
        if(messageD["type"] == "reqvote"){
            console.log("Received vote message");
            submit_vote();
        }
    };
};