diff --git a/community_server/composer.json b/community_server/composer.json index 6a5700b0d..4f9203bd4 100644 --- a/community_server/composer.json +++ b/community_server/composer.json @@ -30,9 +30,9 @@ "autoload": { "psr-4": { "App\\": "src/", - "" : "src/", - "GPBMetadata\\": "src/GPBMetadata", - "Model\\Messages\\Gradido\\" : "src/Model/Messages/Gradido" + "" : "src/", + "GPBMetadata\\Gradido\\": "src/Model/Messages/GPBMetadata/Gradido/", + "Proto\\Gradido\\" : "src/Model/Messages/Proto/Gradido/" } }, "autoload-dev": { diff --git a/community_server/composer.lock b/community_server/composer.lock index 5ee0295c5..41674bb88 100644 --- a/community_server/composer.lock +++ b/community_server/composer.lock @@ -5003,16 +5003,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { @@ -5055,7 +5055,7 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2020-10-23T02:01:07+00:00" + "time": "2021-04-09T00:54:41+00:00" }, { "name": "symfony/finder", diff --git a/community_server/src/GPBMetadata/BasicTypes.php b/community_server/src/GPBMetadata/BasicTypes.php deleted file mode 100644 index f74eb472b..000000000 --- a/community_server/src/GPBMetadata/BasicTypes.php +++ /dev/null @@ -1,41 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0afe030a10426173696354797065732e70726f746f12166d6f64656c2e6d" . - "657373616765732e6772616469646f22380a034b657912110a0765643235" . - "35313918022001280c480012170a0d656432353531395f72656631301803" . - "2001280c480042050a036b657922580a0d5369676e617475726550616972" . - "120e0a067075624b657918012001280c12110a0765643235353139180220" . - "01280c480012170a0d656432353531395f726566313018032001280c4800" . - "420b0a097369676e617475726522460a0c5369676e61747572654d617012" . - "360a077369675061697218012003280b32252e6d6f64656c2e6d65737361" . - "6765732e6772616469646f2e5369676e617475726550616972222b0a0954" . - "696d657374616d70120f0a077365636f6e6473180120012803120d0a056e" . - "616e6f7318022001280522230a1054696d657374616d705365636f6e6473" . - "120f0a077365636f6e647318012001280322590a0c53656e646572416d6f" . - "756e74121d0a15656432353531395f73656e6465725f7075626b65791801" . - "2001280c120e0a06616d6f756e74180220012812121a0a1273656e646572" . - "46696e616c42616c616e636518032001281222410a0e5265636569766572" . - "416d6f756e74121f0a17656432353531395f72656365697665725f707562" . - "6b657918012001280c120e0a06616d6f756e74180220012812620670726f" . - "746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/StateCreateGroup.php b/community_server/src/GPBMetadata/StateCreateGroup.php deleted file mode 100644 index 7098eb808..000000000 --- a/community_server/src/GPBMetadata/StateCreateGroup.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0ae4010a16537461746543726561746547726f75702e70726f746f12166d" . - "6f64656c2e6d657373616765732e6772616469646f22a9010a1053746174" . - "6543726561746547726f7570120c0a046e616d6518012001280912330a0e" . - "67726f75705075626c69634b657918022001280b321b2e6d6f64656c2e6d" . - "657373616765732e6772616469646f2e4b657912390a14706172656e7447" . - "726f75705075626c69634b657918032001280b321b2e6d6f64656c2e6d65" . - "7373616765732e6772616469646f2e4b65794a0408041005521168656465" . - "7261436f6e73656e7375734964620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/StateGroupChangeParent.php b/community_server/src/GPBMetadata/StateGroupChangeParent.php deleted file mode 100644 index c87782041..000000000 --- a/community_server/src/GPBMetadata/StateGroupChangeParent.php +++ /dev/null @@ -1,33 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0a8a020a1c537461746547726f75704368616e6765506172656e742e7072" . - "6f746f12166d6f64656c2e6d657373616765732e6772616469646f22c901" . - "0a16537461746547726f75704368616e6765506172656e7412330a0e6772" . - "6f75705075626c69634b657918012001280b321b2e6d6f64656c2e6d6573" . - "73616765732e6772616469646f2e4b6579123c0a176e6577506172656e74" . - "47726f75705075626c69634b657918022001280b321b2e6d6f64656c2e6d" . - "657373616765732e6772616469646f2e4b6579123c0a176f6c6450617265" . - "6e7447726f75705075626c69634b657918032001280b321b2e6d6f64656c" . - "2e6d657373616765732e6772616469646f2e4b6579620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/Transaction.php b/community_server/src/GPBMetadata/Transaction.php deleted file mode 100644 index d86999450..000000000 --- a/community_server/src/GPBMetadata/Transaction.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0ae4010a115472616e73616374696f6e2e70726f746f12166d6f64656c2e" . - "6d657373616765732e6772616469646f22ae010a0b5472616e7361637469" . - "6f6e120a0a026964180120012804123a0a08726563656976656418022001" . - "280b32282e6d6f64656c2e6d657373616765732e6772616469646f2e5469" . - "6d657374616d705365636f6e647312340a067369674d617018032001280b" . - "32242e6d6f64656c2e6d657373616765732e6772616469646f2e5369676e" . - "61747572654d6170120e0a0674784861736818042001280c12110a09626f" . - "6479427974657318052001280c620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/TransactionBody.php b/community_server/src/GPBMetadata/TransactionBody.php deleted file mode 100644 index 61d99eb96..000000000 --- a/community_server/src/GPBMetadata/TransactionBody.php +++ /dev/null @@ -1,46 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0a84040a155472616e73616374696f6e426f64792e70726f746f12166d6f" . - "64656c2e6d657373616765732e6772616469646f1a165374617465437265" . - "61746547726f75702e70726f746f1a1c537461746547726f75704368616e" . - "6765506172656e742e70726f746f1a195472616e73616374696f6e437265" . - "6174696f6e2e70726f746f1a10426173696354797065732e70726f746f22" . - "e7020a0f5472616e73616374696f6e426f6479120c0a046d656d6f180120" . - "01280912390a076372656174656418022001280b32282e6d6f64656c2e6d" . - "657373616765732e6772616469646f2e54696d657374616d705365636f6e" . - "6473123f0a0b63726561746547726f757018062001280b32282e6d6f6465" . - "6c2e6d657373616765732e6772616469646f2e5374617465437265617465" . - "47726f75704800124b0a1167726f75704368616e6765506172656e741807" . - "2001280b322e2e6d6f64656c2e6d657373616765732e6772616469646f2e" . - "537461746547726f75704368616e6765506172656e74480012340a087472" . - "616e7366657218082001280b32202e6d6f64656c2e6d657373616765732e" . - "6772616469646f2e5472616e736665724800123f0a086372656174696f6e" . - "18092001280b322b2e6d6f64656c2e6d657373616765732e677261646964" . - "6f2e5472616e73616374696f6e4372656174696f6e480042060a04646174" . - "61620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/TransactionCreation.php b/community_server/src/GPBMetadata/TransactionCreation.php deleted file mode 100644 index f1ce2cf1a..000000000 --- a/community_server/src/GPBMetadata/TransactionCreation.php +++ /dev/null @@ -1,32 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0ae6010a195472616e73616374696f6e4372656174696f6e2e70726f746f" . - "12166d6f64656c2e6d657373616765732e6772616469646f22a8010a1354" . - "72616e73616374696f6e4372656174696f6e123e0a0e7265636569766572" . - "416d6f756e7418012001280b32262e6d6f64656c2e6d657373616765732e" . - "6772616469646f2e5265636569766572416d6f756e7412120a0a6964656e" . - "745f68617368180220012811123d0a0b7461726765745f64617465180320" . - "01280b32282e6d6f64656c2e6d657373616765732e6772616469646f2e54" . - "696d657374616d705365636f6e6473620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/GPBMetadata/Transfer.php b/community_server/src/GPBMetadata/Transfer.php deleted file mode 100644 index b0b2c3a2d..000000000 --- a/community_server/src/GPBMetadata/Transfer.php +++ /dev/null @@ -1,31 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0abb010a0e5472616e736665722e70726f746f12166d6f64656c2e6d6573" . - "73616765732e6772616469646f2288010a085472616e73666572123b0a0d" . - "73656e646572416d6f756e747318012003280b32242e6d6f64656c2e6d65" . - "7373616765732e6772616469646f2e53656e646572416d6f756e74123f0a" . - "0f7265636569766572416d6f756e747318022003280b32262e6d6f64656c" . - "2e6d657373616765732e6772616469646f2e5265636569766572416d6f75" . - "6e74620670726f746f33" - ), true); - - static::$is_initialized = true; - } -} - diff --git a/community_server/src/Model/Entity/StateBalance.php b/community_server/src/Model/Entity/StateBalance.php index 0f103b8b9..750366377 100644 --- a/community_server/src/Model/Entity/StateBalance.php +++ b/community_server/src/Model/Entity/StateBalance.php @@ -59,8 +59,8 @@ class StateBalance extends Entity if($decay_duration === 0) { return $this->amount; } - return $this->amount; - //return $this->amount * pow(0.99999997802044727, $decay_duration); + //return $this->amount; + return $this->amount * pow(0.99999997802044727, $decay_duration); } public function partDecay($target_date) @@ -69,8 +69,8 @@ class StateBalance extends Entity if($decay_duration <= 0) { return $this->amount; } - return 0; - //return $this->amount * pow(0.99999997802044727, $decay_duration); + //return 0; + return $this->amount * pow(0.99999997802044727, $decay_duration); } public function decayDuration($target_date) diff --git a/community_server/src/Model/Messages/Proto/Gradido/Key.php b/community_server/src/Model/Messages/Proto/Gradido/Key.php index f18b49a27..4c32e0083 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/Key.php +++ b/community_server/src/Model/Messages/Proto/Gradido/Key.php @@ -22,9 +22,9 @@ class Key extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $ed25519 - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * @type string $ed25519_ref10 - * ed25519 ref10 signature + * ed25519 ref10 signature * } */ public function __construct($data = NULL) { @@ -33,7 +33,7 @@ class Key extends \Google\Protobuf\Internal\Message } /** - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * * Generated from protobuf field bytes ed25519 = 2; * @return string @@ -44,7 +44,7 @@ class Key extends \Google\Protobuf\Internal\Message } /** - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * * Generated from protobuf field bytes ed25519 = 2; * @param string $var @@ -59,7 +59,7 @@ class Key extends \Google\Protobuf\Internal\Message } /** - * ed25519 ref10 signature + * ed25519 ref10 signature * * Generated from protobuf field bytes ed25519_ref10 = 3; * @return string @@ -70,7 +70,7 @@ class Key extends \Google\Protobuf\Internal\Message } /** - * ed25519 ref10 signature + * ed25519 ref10 signature * * Generated from protobuf field bytes ed25519_ref10 = 3; * @param string $var diff --git a/community_server/src/Model/Messages/Proto/Gradido/SignatureMap.php b/community_server/src/Model/Messages/Proto/Gradido/SignatureMap.php index 59b7d7549..0977169d7 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/SignatureMap.php +++ b/community_server/src/Model/Messages/Proto/Gradido/SignatureMap.php @@ -14,7 +14,7 @@ use Google\Protobuf\Internal\GPBUtil; class SignatureMap extends \Google\Protobuf\Internal\Message { /** - * Each signature pair corresponds to a unique Key required to sign the transaction. + * Each signature pair corresponds to a unique Key required to sign the transaction. * * Generated from protobuf field repeated .proto.gradido.SignaturePair sigPair = 1; */ @@ -27,7 +27,7 @@ class SignatureMap extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Proto\Gradido\SignaturePair[]|\Google\Protobuf\Internal\RepeatedField $sigPair - * Each signature pair corresponds to a unique Key required to sign the transaction. + * Each signature pair corresponds to a unique Key required to sign the transaction. * } */ public function __construct($data = NULL) { @@ -36,7 +36,7 @@ class SignatureMap extends \Google\Protobuf\Internal\Message } /** - * Each signature pair corresponds to a unique Key required to sign the transaction. + * Each signature pair corresponds to a unique Key required to sign the transaction. * * Generated from protobuf field repeated .proto.gradido.SignaturePair sigPair = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -47,7 +47,7 @@ class SignatureMap extends \Google\Protobuf\Internal\Message } /** - * Each signature pair corresponds to a unique Key required to sign the transaction. + * Each signature pair corresponds to a unique Key required to sign the transaction. * * Generated from protobuf field repeated .proto.gradido.SignaturePair sigPair = 1; * @param \Proto\Gradido\SignaturePair[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/community_server/src/Model/Messages/Proto/Gradido/SignaturePair.php b/community_server/src/Model/Messages/Proto/Gradido/SignaturePair.php index 986596e3c..2ef0e81c5 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/SignaturePair.php +++ b/community_server/src/Model/Messages/Proto/Gradido/SignaturePair.php @@ -27,9 +27,9 @@ class SignaturePair extends \Google\Protobuf\Internal\Message * * @type string $pubKey * @type string $ed25519 - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * @type string $ed25519_ref10 - * ed25519 ref10 signature + * ed25519 ref10 signature * } */ public function __construct($data = NULL) { @@ -60,7 +60,7 @@ class SignaturePair extends \Google\Protobuf\Internal\Message } /** - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * * Generated from protobuf field bytes ed25519 = 2; * @return string @@ -71,7 +71,7 @@ class SignaturePair extends \Google\Protobuf\Internal\Message } /** - * ed25519 signature (libsodium default) + * ed25519 signature (libsodium default) * * Generated from protobuf field bytes ed25519 = 2; * @param string $var @@ -86,7 +86,7 @@ class SignaturePair extends \Google\Protobuf\Internal\Message } /** - * ed25519 ref10 signature + * ed25519 ref10 signature * * Generated from protobuf field bytes ed25519_ref10 = 3; * @return string @@ -97,7 +97,7 @@ class SignaturePair extends \Google\Protobuf\Internal\Message } /** - * ed25519 ref10 signature + * ed25519 ref10 signature * * Generated from protobuf field bytes ed25519_ref10 = 3; * @param string $var diff --git a/community_server/src/Model/Messages/Proto/Gradido/Timestamp.php b/community_server/src/Model/Messages/Proto/Gradido/Timestamp.php index 3d8d2ed7a..ae3ecea0e 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/Timestamp.php +++ b/community_server/src/Model/Messages/Proto/Gradido/Timestamp.php @@ -16,13 +16,13 @@ use Google\Protobuf\Internal\GPBUtil; class Timestamp extends \Google\Protobuf\Internal\Message { /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; */ private $seconds = 0; /** - * Number of nanoseconds since the start of the last second + * Number of nanoseconds since the start of the last second * * Generated from protobuf field int32 nanos = 2; */ @@ -35,9 +35,9 @@ class Timestamp extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $seconds - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * @type int $nanos - * Number of nanoseconds since the start of the last second + * Number of nanoseconds since the start of the last second * } */ public function __construct($data = NULL) { @@ -46,7 +46,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message } /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; * @return int|string @@ -57,7 +57,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message } /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; * @param int|string $var @@ -72,7 +72,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message } /** - * Number of nanoseconds since the start of the last second + * Number of nanoseconds since the start of the last second * * Generated from protobuf field int32 nanos = 2; * @return int @@ -83,7 +83,7 @@ class Timestamp extends \Google\Protobuf\Internal\Message } /** - * Number of nanoseconds since the start of the last second + * Number of nanoseconds since the start of the last second * * Generated from protobuf field int32 nanos = 2; * @param int $var diff --git a/community_server/src/Model/Messages/Proto/Gradido/TimestampSeconds.php b/community_server/src/Model/Messages/Proto/Gradido/TimestampSeconds.php index dda39a858..d31aa40d2 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/TimestampSeconds.php +++ b/community_server/src/Model/Messages/Proto/Gradido/TimestampSeconds.php @@ -16,7 +16,7 @@ use Google\Protobuf\Internal\GPBUtil; class TimestampSeconds extends \Google\Protobuf\Internal\Message { /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; */ @@ -29,7 +29,7 @@ class TimestampSeconds extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int|string $seconds - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * } */ public function __construct($data = NULL) { @@ -38,7 +38,7 @@ class TimestampSeconds extends \Google\Protobuf\Internal\Message } /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; * @return int|string @@ -49,7 +49,7 @@ class TimestampSeconds extends \Google\Protobuf\Internal\Message } /** - * Number of complete seconds since the start of the epoch + * Number of complete seconds since the start of the epoch * * Generated from protobuf field int64 seconds = 1; * @param int|string $var diff --git a/community_server/src/Model/Messages/Proto/Gradido/TransactionBody.php b/community_server/src/Model/Messages/Proto/Gradido/TransactionBody.php index 0484ecc92..b1ad01ea4 100644 --- a/community_server/src/Model/Messages/Proto/Gradido/TransactionBody.php +++ b/community_server/src/Model/Messages/Proto/Gradido/TransactionBody.php @@ -20,7 +20,11 @@ class TransactionBody extends \Google\Protobuf\Internal\Message */ private $memo = ''; /** - * Generated from protobuf field uint64 version_number = 6; + * Generated from protobuf field .proto.gradido.TimestampSeconds created = 2; + */ + private $created = null; + /** + * Generated from protobuf field uint64 version_number = 3; */ private $version_number = 0; protected $data; @@ -33,11 +37,12 @@ class TransactionBody extends \Google\Protobuf\Internal\Message * * @type string $memo * max 150 chars + * @type \Proto\Gradido\TimestampSeconds $created + * @type int|string $version_number * @type \Proto\Gradido\GradidoTransfer $transfer * @type \Proto\Gradido\GradidoCreation $creation * @type \Proto\Gradido\GroupFriendsUpdate $group_friends_update * @type \Proto\Gradido\GroupMemberUpdate $group_member_update - * @type int|string $version_number * } */ public function __construct($data = NULL) { @@ -72,95 +77,29 @@ class TransactionBody extends \Google\Protobuf\Internal\Message } /** - * Generated from protobuf field .proto.gradido.GradidoTransfer transfer = 2; - * @return \Proto\Gradido\GradidoTransfer + * Generated from protobuf field .proto.gradido.TimestampSeconds created = 2; + * @return \Proto\Gradido\TimestampSeconds */ - public function getTransfer() + public function getCreated() { - return $this->readOneof(2); + return $this->created; } /** - * Generated from protobuf field .proto.gradido.GradidoTransfer transfer = 2; - * @param \Proto\Gradido\GradidoTransfer $var + * Generated from protobuf field .proto.gradido.TimestampSeconds created = 2; + * @param \Proto\Gradido\TimestampSeconds $var * @return $this */ - public function setTransfer($var) + public function setCreated($var) { - GPBUtil::checkMessage($var, \Proto\Gradido\GradidoTransfer::class); - $this->writeOneof(2, $var); + GPBUtil::checkMessage($var, \Proto\Gradido\TimestampSeconds::class); + $this->created = $var; return $this; } /** - * Generated from protobuf field .proto.gradido.GradidoCreation creation = 3; - * @return \Proto\Gradido\GradidoCreation - */ - public function getCreation() - { - return $this->readOneof(3); - } - - /** - * Generated from protobuf field .proto.gradido.GradidoCreation creation = 3; - * @param \Proto\Gradido\GradidoCreation $var - * @return $this - */ - public function setCreation($var) - { - GPBUtil::checkMessage($var, \Proto\Gradido\GradidoCreation::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Generated from protobuf field .proto.gradido.GroupFriendsUpdate group_friends_update = 4; - * @return \Proto\Gradido\GroupFriendsUpdate - */ - public function getGroupFriendsUpdate() - { - return $this->readOneof(4); - } - - /** - * Generated from protobuf field .proto.gradido.GroupFriendsUpdate group_friends_update = 4; - * @param \Proto\Gradido\GroupFriendsUpdate $var - * @return $this - */ - public function setGroupFriendsUpdate($var) - { - GPBUtil::checkMessage($var, \Proto\Gradido\GroupFriendsUpdate::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Generated from protobuf field .proto.gradido.GroupMemberUpdate group_member_update = 5; - * @return \Proto\Gradido\GroupMemberUpdate - */ - public function getGroupMemberUpdate() - { - return $this->readOneof(5); - } - - /** - * Generated from protobuf field .proto.gradido.GroupMemberUpdate group_member_update = 5; - * @param \Proto\Gradido\GroupMemberUpdate $var - * @return $this - */ - public function setGroupMemberUpdate($var) - { - GPBUtil::checkMessage($var, \Proto\Gradido\GroupMemberUpdate::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Generated from protobuf field uint64 version_number = 6; + * Generated from protobuf field uint64 version_number = 3; * @return int|string */ public function getVersionNumber() @@ -169,7 +108,7 @@ class TransactionBody extends \Google\Protobuf\Internal\Message } /** - * Generated from protobuf field uint64 version_number = 6; + * Generated from protobuf field uint64 version_number = 3; * @param int|string $var * @return $this */ @@ -181,6 +120,94 @@ class TransactionBody extends \Google\Protobuf\Internal\Message return $this; } + /** + * Generated from protobuf field .proto.gradido.GradidoTransfer transfer = 6; + * @return \Proto\Gradido\GradidoTransfer + */ + public function getTransfer() + { + return $this->readOneof(6); + } + + /** + * Generated from protobuf field .proto.gradido.GradidoTransfer transfer = 6; + * @param \Proto\Gradido\GradidoTransfer $var + * @return $this + */ + public function setTransfer($var) + { + GPBUtil::checkMessage($var, \Proto\Gradido\GradidoTransfer::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Generated from protobuf field .proto.gradido.GradidoCreation creation = 7; + * @return \Proto\Gradido\GradidoCreation + */ + public function getCreation() + { + return $this->readOneof(7); + } + + /** + * Generated from protobuf field .proto.gradido.GradidoCreation creation = 7; + * @param \Proto\Gradido\GradidoCreation $var + * @return $this + */ + public function setCreation($var) + { + GPBUtil::checkMessage($var, \Proto\Gradido\GradidoCreation::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Generated from protobuf field .proto.gradido.GroupFriendsUpdate group_friends_update = 8; + * @return \Proto\Gradido\GroupFriendsUpdate + */ + public function getGroupFriendsUpdate() + { + return $this->readOneof(8); + } + + /** + * Generated from protobuf field .proto.gradido.GroupFriendsUpdate group_friends_update = 8; + * @param \Proto\Gradido\GroupFriendsUpdate $var + * @return $this + */ + public function setGroupFriendsUpdate($var) + { + GPBUtil::checkMessage($var, \Proto\Gradido\GroupFriendsUpdate::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Generated from protobuf field .proto.gradido.GroupMemberUpdate group_member_update = 9; + * @return \Proto\Gradido\GroupMemberUpdate + */ + public function getGroupMemberUpdate() + { + return $this->readOneof(9); + } + + /** + * Generated from protobuf field .proto.gradido.GroupMemberUpdate group_member_update = 9; + * @param \Proto\Gradido\GroupMemberUpdate $var + * @return $this + */ + public function setGroupMemberUpdate($var) + { + GPBUtil::checkMessage($var, \Proto\Gradido\GroupMemberUpdate::class); + $this->writeOneof(9, $var); + + return $this; + } + /** * @return string */ diff --git a/community_server/src/Model/Transactions/SignatureMap.php b/community_server/src/Model/Transactions/SignatureMap.php index 438961e4a..cbe48e636 100644 --- a/community_server/src/Model/Transactions/SignatureMap.php +++ b/community_server/src/Model/Transactions/SignatureMap.php @@ -29,12 +29,12 @@ class SignatureMap { static public function fromEntity($transactionSignatures) { - $protoSigMap = new \Model\Messages\Proto\Gradido\SignatureMap(); + $protoSigMap = new \Proto\Gradido\SignatureMap(); $sigPairs = $protoSigMap->getSigPair(); //echo "sigPairs: "; var_dump($sigPairs); echo "
"; //return null; foreach($transactionSignatures as $signature) { - $sigPair = new \Model\Messages\Proto\Gradido\SignaturePair(); + $sigPair = new \Proto\Gradido\SignaturePair(); $sigPair->setPubKey(stream_get_contents($signature->pubkey)); $sigPair->setEd25519(stream_get_contents($signature->signature)); @@ -46,14 +46,14 @@ class SignatureMap { static public function build($bodyBytes, array $keys) { - $protoSigMap = new \Model\Messages\Proto\Gradido\SignatureMap(); + $protoSigMap = new \Proto\Gradido\SignatureMap(); $sigPairs = $protoSigMap->getSigPair(); //echo "sigPairs: "; var_dump($sigPairs); echo "
"; //return null; // sign with keys foreach($keys as $key) { - $sigPair = new \Model\Messages\Proto\Gradido\SignaturePair(); + $sigPair = new \Proto\Gradido\SignaturePair(); $sigPair->setPubKey(hex2bin($key['pub'])); $sigPair->setEd25519(sodium_crypto_sign_detached($bodyBytes, hex2bin($key['priv']))); diff --git a/community_server/src/Model/Transactions/Transaction.php b/community_server/src/Model/Transactions/Transaction.php index 49d64634f..da21495b9 100644 --- a/community_server/src/Model/Transactions/Transaction.php +++ b/community_server/src/Model/Transactions/Transaction.php @@ -25,7 +25,7 @@ class Transaction extends TransactionBase { //$transactionBin = base64_decode($base64Data, true); //if($transactionBin == false) { //sodium_base64_VARIANT_URLSAFE_NO_PADDING - if(is_a($base64Data, '\Model\Messages\Proto\Gradido\Transaction')) { + if(is_a($base64Data, '\Proto\Gradido\Transaction')) { $this->mProtoTransaction = $base64Data; $this->mTransactionBody = new TransactionBody($this->mProtoTransaction->getBodyBytes()); return; @@ -50,7 +50,7 @@ class Transaction extends TransactionBase { $this->addError('Transaction', 'base64 decode error: ' . $base64Data); } else { //var_dump($transactionBin); - $this->mProtoTransaction = new \Model\Messages\Proto\Gradido\Transaction(); + $this->mProtoTransaction = new \Proto\Gradido\GradidoTransaction(); try { $this->mProtoTransaction->mergeFromString($transactionBin); //var_dump($this->mProtoTransaction); @@ -70,11 +70,11 @@ class Transaction extends TransactionBase { } } - static public function build(\Model\Messages\Proto\Gradido\TransactionBody $transactionBody, $senderKeyPair) + static public function build(\Proto\Gradido\TransactionBody $transactionBody, $senderKeyPair) { - $protoTransaction = new \Model\Messages\Proto\Gradido\Transaction(); + $protoTransaction = new \Proto\Gradido\GradidoTransaction(); - $recevied = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $recevied = new \Proto\Gradido\TimestampSeconds(); $recevied->setSeconds(time()); $protoTransaction->setReceived($recevied); @@ -198,14 +198,14 @@ class Transaction extends TransactionBase { 'TransactionSignatures']) ->first(); //var_dump($transactionEntry->toArray()); - $protoTransaction = new \Model\Messages\Proto\Gradido\Transaction(); + $protoTransaction = new \Proto\Gradido\Transaction(); $protoTransaction->setId($transactionEntry->id); - $recevied = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $recevied = new \Proto\Gradido\TimestampSeconds(); $recevied->setSeconds($transactionEntry->received->getTimestamp()); $protoTransaction->setReceived($recevied); @@ -229,7 +229,7 @@ class Transaction extends TransactionBase { } //echo "verify bodybytes:
" . bin2hex($bodyBytes) . '
'; - $created = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $created = new \Proto\Gradido\TimestampSeconds(); $created->setSeconds($recevied->getSeconds()); $body->setCreated($created); $bodyBytes = $body->serializeToString(); diff --git a/community_server/src/Model/Transactions/TransactionBody.php b/community_server/src/Model/Transactions/TransactionBody.php index e7bf2a392..e0d688dbb 100644 --- a/community_server/src/Model/Transactions/TransactionBody.php +++ b/community_server/src/Model/Transactions/TransactionBody.php @@ -12,7 +12,7 @@ class TransactionBody extends TransactionBase { private $transactionTypeId = 0; public function __construct($bodyBytes) { - $this->mProtoTransactionBody = new \Model\Messages\Proto\Gradido\TransactionBody(); + $this->mProtoTransactionBody = new \Proto\Gradido\TransactionBody(); try { $this->mProtoTransactionBody->mergeFromString($bodyBytes); // cannot catch Exception with cakePHP, I don't know why @@ -155,7 +155,7 @@ class TransactionBody extends TransactionBase { static public function fromEntity($memo, $transaction) { - $protoBody = new \Model\Messages\Proto\Gradido\TransactionBody(); + $protoBody = new \Proto\Gradido\TransactionBody(); $protoBody->setMemo($memo); //$created->setSeconds($var); @@ -176,7 +176,7 @@ class TransactionBody extends TransactionBase { static public function build($memo, $specificTransaction) { - $protoBody = new \Model\Messages\Proto\Gradido\TransactionBody(); + $protoBody = new \Proto\Gradido\TransactionBody(); $protoBody->setMemo($memo); if(is_a($specificTransaction, 'TransactionCreation')) { diff --git a/community_server/src/Model/Transactions/TransactionCreation.php b/community_server/src/Model/Transactions/TransactionCreation.php index 872e04ed9..54a87e1cb 100644 --- a/community_server/src/Model/Transactions/TransactionCreation.php +++ b/community_server/src/Model/Transactions/TransactionCreation.php @@ -28,7 +28,7 @@ class TransactionCreation extends TransactionBase { static public function build($amount, $memo, $receiver_public_hex, $targetDate = null) { - $receiver = new \Model\Messages\Proto\Gradido\TransferAmount(); + $receiver = new \Proto\Gradido\TransferAmount(); $receiver->setAmount($amount); //$this->receiver_pubkey_hex = $receiver_public_hex; if(strlen($receiver_public_hex) != 64) { @@ -38,10 +38,10 @@ class TransactionCreation extends TransactionBase { $receiver->setPubkey($pubKeyBin); //var_dump($requestData); - $creationDate = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $creationDate = new \Proto\Gradido\TimestampSeconds(); $creationDate->setSeconds(time()); - $transactionBody = new \Model\Messages\Proto\Gradido\TransactionBody(); + $transactionBody = new \Proto\Gradido\TransactionBody(); $transactionBody->setMemo($memo); $transactionBody->setCreated($creationDate); @@ -52,7 +52,7 @@ class TransactionCreation extends TransactionBase { //var_dump($targetDate); //die('die'); if($targetDate) { - $targetDateTimestamp = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $targetDateTimestamp = new \Proto\Gradido\TimestampSeconds(); $targetDateTimestamp->setSeconds($targetDate->getTimestamp()); //var_dump($targetDateTimestamp); die('target'); $transaction->setTargetDate($targetDateTimestamp); @@ -209,7 +209,7 @@ class TransactionCreation extends TransactionBase { static public function fromEntity($transactionCreationEntity) { - $protoCreation = new \Model\Messages\Proto\Gradido\GradidoCreation(); + $protoCreation = new \Proto\Gradido\GradidoCreation(); //var_dump($transactionCreationEntity); $stateUsersTable = TableRegistry::getTableLocator()->get('state_users'); @@ -220,7 +220,7 @@ class TransactionCreation extends TransactionBase { $stateUser = $stateUsersTable->get($userId); - $receiverAmount = new \Model\Messages\Proto\Gradido\TransferAmount(); + $receiverAmount = new \Proto\Gradido\TransferAmount(); $receiverAmount->setPubkey(stream_get_contents($stateUser->public_key)); $receiverAmount->setAmount($transactionCreationEntity->amount); diff --git a/community_server/src/Model/Transactions/TransactionTransfer.php b/community_server/src/Model/Transactions/TransactionTransfer.php index 9f7ebd41f..caceec704 100644 --- a/community_server/src/Model/Transactions/TransactionTransfer.php +++ b/community_server/src/Model/Transactions/TransactionTransfer.php @@ -23,7 +23,7 @@ class TransactionTransfer extends TransactionBase { // repeated SenderAmount senderAmounts = 1; // repeated ReceiverAmount receiverAmounts = 2; - $sender = new \Model\Messages\Proto\Gradido\TransferAmount(); + $sender = new \Proto\Gradido\TransferAmount(); $sender->setAmount($amount); if(strlen($receiver_public_hex) != 64) { @@ -38,15 +38,15 @@ class TransactionTransfer extends TransactionBase { $sender->setPubkey($senderPubKeyBin); //var_dump($requestData); - $creationDate = new \Model\Messages\Proto\Gradido\TimestampSeconds(); + $creationDate = new \Proto\Gradido\TimestampSeconds(); $creationDate->setSeconds(time()); - $transactionBody = new \Model\Messages\Proto\Gradido\TransactionBody(); + $transactionBody = new \Proto\Gradido\TransactionBody(); $transactionBody->setMemo($memo); $transactionBody->setCreated($creationDate); - $transfer = new \Model\Messages\Proto\Gradido\GradidoTransfer(); - $local_transfer = new \Model\Messages\Proto\Gradido\LocalTransfer(); + $transfer = new \Proto\Gradido\GradidoTransfer(); + $local_transfer = new \Proto\Gradido\LocalTransfer(); $local_transfer->setReceiver($receiverPubKeyBin); $local_transfer->setSender($sender); $transfer->setLocal($local_transfer); diff --git a/community_server/src/protobuf b/community_server/src/protobuf index 81a461566..77dee5685 160000 --- a/community_server/src/protobuf +++ b/community_server/src/protobuf @@ -1 +1 @@ -Subproject commit 81a461566e46d71533dc3e284fa075d7d68fd020 +Subproject commit 77dee5685ebba543ea1cd2321580ad56c92f5775