// Get gets protocol version based on blockchain(transaction) time.
Get gets protocol version based on blockchain(transaction) time.
// Get gets protocol version based on blockchain ( transaction ) time .
func (c *Client) Get(genesisTime uint64) (protocol.Version, error) {
	logger.Debugf("available protocols: %s", c.protocols)
	for i := len(c.protocols) - 1; i >= 0; i-- {
		pv := c.protocols[i]
		p := pv.Protocol()
		logger.Debugf("Checking protocol for version genesis time %d: %+v", genesisTime, p)
		if genesisTime == p.GenesisTime {
			logger.Debugf("Found protocol for version genesis time %d: %+v", genesisTime, p)
			return pv, nil
		}
	}
	return nil, fmt.Errorf("protocol parameters are not defined for version genesis time: %d", genesisTime)
}
func ( c * Client ) Get ( genesisTime uint64 ) ( protocol . Version , error ) { logger . Debugf ( " " , c . protocols ) for i := len ( c . protocols ) - 1 ; i >= 0 ; i -- { pv := c . protocols [ i ] p := pv . Protocol ( ) logger . Debugf ( " " , genesisTime , p ) if genesisTime == p . GenesisTime { logger . Debugf ( " " , genesisTime , p ) return pv , nil } } return nil , fmt . Errorf ( " " , genesisTime ) }
Get gets protocol version based on blockchain(transaction) time.
Get gets protocol version based on blockchain ( transaction ) time .