package models

type RaspVersionTest struct {
	//Model
	Id   int64 `json:"id" gorm:"PRIMARY_KEY"`
	Version   string `json:"version"`
	Type int32 `json:"type"`
	Addtime int64 `json:"addtime"`
}

// GetHeight get lastheight in chain33
func GetVersionTest(t int32) (string, error) {
	var rasp RaspVersionTest
	err := db.Model(&RaspVersionTest{}).Where("type = ?",t).Order("id desc").First(&rasp).Error
	if err != nil  {
		return "",err
	}
	return rasp.Version, nil
}

