Some checks failed
		
		
	
	Build / build (push) Has been cancelled
				
			CodeQL / Analyze (go) (push) Has been cancelled
				
			build / Build (push) Has been cancelled
				
			GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
				
			GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
				
			Issue Close Require / issue-close-require (push) Has been cancelled
				
			2、查询平台剩余字符数
		
			
				
	
	
		
			29 lines
		
	
	
		
			721 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			721 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package jobs
 | |
| 
 | |
| import (
 | |
| 	"go-admin/config"
 | |
| 	"go-admin/utils/redishelper"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/go-admin-team/go-admin-core/sdk"
 | |
| 	"gorm.io/driver/mysql"
 | |
| 	"gorm.io/gorm"
 | |
| )
 | |
| 
 | |
| func TestTrxPaymentJob(t *testing.T) {
 | |
| 	dsn := "root:123456@tcp(127.0.0.1:3306)/aggregate_translate?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
 | |
| 	db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
 | |
| 	sdk.Runtime.SetDb("default", db)
 | |
| 	config.ExtConfig.TrxGridUrl = "https://api.trongrid.io"
 | |
| 	redishelper.InitDefaultRedis("127.0.0.1:6379", "", 1)
 | |
| 	redishelper.InitLockRedisConn("127.0.0.1:6379", "", "1")
 | |
| 
 | |
| 	trxPaymentJob := TrxPaymentJob{}
 | |
| 
 | |
| 	err := trxPaymentJob.Exec(nil)
 | |
| 
 | |
| 	if err != nil {
 | |
| 		t.Error(err)
 | |
| 	}
 | |
| }
 |