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.
29 lines
591 B
29 lines
591 B
6 months ago
|
package service
|
||
|
|
||
|
import (
|
||
|
"math/rand"
|
||
|
"shop-api/model/response"
|
||
|
"shop-api/utils"
|
||
|
"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
|
||
|
}
|