for i := uint64(0); i <= a.chain.BestBlockHeight(); i++ {
block, err := a.chain.GetBlockByHeight(i)
if err != nil {
- t.Error("case %d got err %v", err)
+ t.Errorf("case %d got err %v", i, err)
}
got = append(got, block)
}
for i := uint64(0); i <= a.chain.BestBlockHeight(); i++ {
block, err := a.chain.GetBlockByHeight(i)
if err != nil {
- t.Error("case %d got err %v", err)
+ t.Errorf("case %d got err %v", i, err)
}
got = append(got, block)
}
gotTxs, err := w.GetUnconfirmedTxs("")
for i, want := range wantTxs {
if !testutil.DeepEqual(gotTxs[i].ID, want.ID) {
- t.Errorf(`the NO %i transaction, tx got=%#v; want=%#v`, i, gotTxs[i].ID.String(), want.ID.String())
+ t.Errorf(`the NO %d transaction, tx got=%#v; want=%#v`, i, gotTxs[i].ID.String(), want.ID.String())
}
for j, input := range want.Inputs {
if !testutil.DeepEqual(gotTxs[i].Inputs[j].AccountID, input.AccountID) {
- t.Errorf(`the NO %i transaction input, accountID got=%#v; want=%#v`, j, gotTxs[i].Inputs[j].AccountID, input.AccountID)
+ t.Errorf(`the NO %d transaction input, accountID got=%#v; want=%#v`, j, gotTxs[i].Inputs[j].AccountID, input.AccountID)
}
if !testutil.DeepEqual(gotTxs[i].Inputs[j].AssetID, input.AssetID) {
- t.Errorf(`the NO %i transaction input, assetID got=%#v; want=%#v`, j, gotTxs[i].Inputs[j].AssetID, input.AssetID)
+ t.Errorf(`the NO %d transaction input, assetID got=%#v; want=%#v`, j, gotTxs[i].Inputs[j].AssetID, input.AssetID)
}
}
for k, output := range want.Outputs {
if !testutil.DeepEqual(gotTxs[i].Outputs[k].AccountID, output.AccountID) {
- t.Errorf(`the NO %i transaction input, accountID got=%#v; want=%#v`, k, gotTxs[i].Inputs[k].AccountID, output.AccountID)
+ t.Errorf(`the NO %d transaction input, accountID got=%#v; want=%#v`, k, gotTxs[i].Inputs[k].AccountID, output.AccountID)
}
if !testutil.DeepEqual(gotTxs[i].Outputs[k].AssetID, output.AssetID) {
- t.Errorf(`the NO %i transaction input, assetID got=%#v; want=%#v`, k, gotTxs[i].Inputs[k].AssetID, output.AssetID)
+ t.Errorf(`the NO %d transaction input, assetID got=%#v; want=%#v`, k, gotTxs[i].Inputs[k].AssetID, output.AssetID)
}
}
}