From 29f8c86632876c19fd026cdc0f4ffad198a007d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Pichulin Date: Thu, 15 Aug 2024 17:05:48 +0300 Subject: [PATCH 1/3] no more first --- src/API/Node.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/API/Node.php b/src/API/Node.php index e63f155..53d2aa0 100644 --- a/src/API/Node.php +++ b/src/API/Node.php @@ -456,7 +456,7 @@ function getBlocks( int $fromHeight, int $toHeight ): array function getGenesisBlock(): Block { - return $this->get( '/blocks/first' )->asBlock(); + return $this->get( '/blocks/at/1' )->asBlock(); } function getLastBlock(): Block From 5301be7ffc7a7ff2bda4ea98ca20a01a5436e3ac Mon Sep 17 00:00:00 2001 From: Dmitrii Pichulin Date: Thu, 15 Aug 2024 17:06:17 +0300 Subject: [PATCH 2/3] tests tuning --- tests/NodeTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/NodeTest.php b/tests/NodeTest.php index ee5555d..4a893bc 100644 --- a/tests/NodeTest.php +++ b/tests/NodeTest.php @@ -154,7 +154,17 @@ function testNode(): void $block = $nodeW->getLastBlock(); $blocks = $nodeW->getBlocksGeneratedBy( $block->generator(), $heightW - 10, $heightW ); - $blocks = $nodeW->getBlocks( $heightW - 4, $heightW ); + try + { + $blocks = $nodeW->getBlocks( $heightW - 4, $heightW ); + } + catch( Exception $e ) + { + if( false !== strpos( $e->getMessage(), 'HTTP 429' ) ) + sleep( 5 ); + $blocks = $nodeW->getBlocks( $heightW - 4, $heightW ); + } + $this->assertSame( 5, count( $blocks ) ); foreach( $blocks as $block ) foreach( $block->transactions() as $tx ) @@ -411,7 +421,7 @@ function testExceptions(): void $json = $node->get( '/blocks/headers/last' ); $this->catchExceptionOrFail( ExceptionCode::FETCH_URI, function() use ( $node ){ $node->get( '/test' ); } ); - $this->catchExceptionOrFail( ExceptionCode::JSON_DECODE, function() use ( $node ){ $node->get( '/api-docs/favicon-16x16.png' ); } ); + $this->catchExceptionOrFail( ExceptionCode::JSON_DECODE, function() use ( $node ){ $node->get( '/api-docs/index.css' ); } ); $this->catchExceptionOrFail( ExceptionCode::KEY_MISSING, function() use ( $json ){ $json->get( 'x' ); } ); $this->catchExceptionOrFail( ExceptionCode::INT_EXPECTED, function() use ( $json ){ $json->get( 'signature' )->asInt(); } ); $this->catchExceptionOrFail( ExceptionCode::STRING_EXPECTED, function() use ( $json ){ $json->get( 'height' )->asString(); } ); From 85e850b28cd1424f75be59ac9962e73fa2c086c7 Mon Sep 17 00:00:00 2001 From: Dmitrii Pichulin Date: Thu, 15 Aug 2024 17:11:11 +0300 Subject: [PATCH 3/3] fix scheme update --- src/Model/DataEntry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/DataEntry.php b/src/Model/DataEntry.php index ea0c55f..0bb5b99 100644 --- a/src/Model/DataEntry.php +++ b/src/Model/DataEntry.php @@ -122,9 +122,9 @@ function booleanValue(): bool return Value::as( $this->value() )->asBoolean(); } - function toProtobuf(): \Waves\Protobuf\DataTransactionData\DataEntry + function toProtobuf(): \Waves\Protobuf\DataEntry { - $pb_DataEntry = new \Waves\Protobuf\DataTransactionData\DataEntry; + $pb_DataEntry = new \Waves\Protobuf\DataEntry; $pb_DataEntry->setKey( $this->key() ); switch( $this->type() ) {