Skip to content
Snippets Groups Projects
Select Git revision
  • 520c4f932a6a9c9fd5db09bf5b333d7845631b04
  • master default protected
2 results

datastructures.go

Blame
  • datastructures.go 739 B
    package types
    
    // Message - MessageBody can be of any type but will be use here for Transaction, AckTransaction
    type Message struct {
    	MessageType string      `json:"messageType"`
    	MessageBody interface{} `json:"messageBody"`
    }
    
    // Transaction - represents a transaction in the blockchain
    type Transaction struct {
    	Id       string `json:"id"`
    	Sender   string `json:"sender"`
    	Receiver string `json:"receiver"`
    	Amount   string `json:"amount"`
    }
    
    // AckTransaction - represents an acknowledgement of a transaction @see vote function
    type AckTransaction struct {
    	Id                  string `json:"id"`
    	AmountOfCorrectNode int    `json:"amountOfCorrectNode"`
    	TotalNodes          int    `json:"totalNodes"`
    }
    
    type Database []Transaction