You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
595 B
28 lines
595 B
package service
|
|
|
|
import (
|
|
"bkb-seller/model/response"
|
|
"bkb-seller/utils"
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func GetChainInfo(address string) (error, []response.ChainResp) {
|
|
var (
|
|
err error
|
|
result []response.ChainResp
|
|
)
|
|
now := time.Now()
|
|
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
for i := 0; i < 3; i++ {
|
|
intn := r.Intn(1000)
|
|
tmp := response.ChainResp{
|
|
Time: &now,
|
|
BlockHeight: 28741283 + int64(intn),
|
|
BlockAddress: utils.GetInvitationLowerLen(64),
|
|
Hash: utils.GetInvitationLowerLen(64),
|
|
}
|
|
result = append(result, tmp)
|
|
}
|
|
return err, result
|
|
}
|
|
|