|
|
@@ -319,3 +319,19 @@ func TestTransactionInBlockInterrupted(t *testing.T) {
|
|
|
t.Fatal("error should not be nil")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TestChainID(t *testing.T) {
|
|
|
+ backend, _ := newTestBackend(t)
|
|
|
+ client, _ := backend.Attach()
|
|
|
+ defer backend.Stop()
|
|
|
+ defer client.Close()
|
|
|
+ ec := NewClient(client)
|
|
|
+
|
|
|
+ id, err := ec.ChainID(context.Background())
|
|
|
+ if err != nil {
|
|
|
+ t.Fatalf("unexpected error: %v", err)
|
|
|
+ }
|
|
|
+ if id == nil || id.Cmp(params.AllEthashProtocolChanges.ChainID) != 0 {
|
|
|
+ t.Fatalf("ChainID returned wrong number: %+v", id)
|
|
|
+ }
|
|
|
+}
|