24 lines
		
	
	
		
			627 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			627 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package jobs
 | |
| 
 | |
| import (
 | |
| 	"go-admin/config"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/go-admin-team/go-admin-core/sdk"
 | |
| 	"gorm.io/driver/mysql"
 | |
| 	"gorm.io/gorm"
 | |
| )
 | |
| 
 | |
| func TestTransferJob(t *testing.T) {
 | |
| 	dsn := "root:123456@tcp(127.0.0.1:3306)/eth_transfer?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
 | |
| 	db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
 | |
| 	sdk.Runtime.SetDb("default", db)
 | |
| 
 | |
| 	config.ExtConfig.ApiEndpoint = "https://stylish-cool-fire.ethereum-sepolia.quiknode.pro/17572db4c091accfa5dc6faa0c60a805e5173459"
 | |
| 	config.ExtConfig.ProxyUrl = "http://127.0.0.1:7890"
 | |
| 
 | |
| 	job := TransferJob{}
 | |
| 
 | |
| 	job.Exec(nil)
 | |
| }
 |