File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,26 @@ public function show(string $id): array
4444 return $ this ->get ("blocks/ {$ id }" );
4545 }
4646
47+ /**
48+ * Get the first block.
49+ *
50+ * @return array
51+ */
52+ public function first (): array
53+ {
54+ return $ this ->get ('blocks/first ' );
55+ }
56+
57+ /**
58+ * Get the last block.
59+ *
60+ * @return array
61+ */
62+ public function last (): array
63+ {
64+ return $ this ->get ('blocks/last ' );
65+ }
66+
4767 /**
4868 * Get all transactions by the given block.
4969 *
Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ public function show_calls_correct_url()
3939 });
4040 }
4141
42+ /** @test */
43+ public function first_calls_correct_url ()
44+ {
45+ $ this ->assertResponse ('GET ' , 'blocks/first ' , function ($ connection ) {
46+ return $ connection ->blocks ()->first ();
47+ });
48+ }
49+
50+ /** @test */
51+ public function last_calls_correct_url ()
52+ {
53+ $ this ->assertResponse ('GET ' , 'blocks/last ' , function ($ connection ) {
54+ return $ connection ->blocks ()->last ();
55+ });
56+ }
57+
4258 /** @test */
4359 public function transactions_calls_correct_url ()
4460 {
You can’t perform that action at this time.
0 commit comments