github.com/sixexorg/magnetic-ring@v0.0.0-20191119090307-31705a21e419/store/mainchain/extstorages/league_block_test.go (about) 1 package extstorages 2 3 import ( 4 "testing" 5 6 "github.com/sixexorg/magnetic-ring/mock" 7 ) 8 9 func TestBlockHashStore(t *testing.T) { 10 11 hashes, gasSum, err := store.GetBlockHashSpan(mock.LeagueAddress1, 2, 4) 12 if err != nil { 13 t.Error(err) 14 t.Fail() 15 return 16 } 17 for k, v := range hashes { 18 t.Logf("key:%d ,val:%s\n", k, v.String()) 19 } 20 t.Log("gasSum:", gasSum.Uint64()) 21 } 22 23 func TestGetBlock(t *testing.T) { 24 blk3, err := store.GetBlock(mock.LeagueAddress1, 3) 25 if err != nil { 26 t.Error(err) 27 t.Fail() 28 return 29 } 30 t.Log(blk3.Header, blk3.EnergyUsed, blk3.TxHashes) 31 }