diff --git a/src/Enums/AbiFunction.php b/src/Enums/AbiFunction.php new file mode 100644 index 00000000..1832719c --- /dev/null +++ b/src/Enums/AbiFunction.php @@ -0,0 +1,28 @@ + Vote::class, + self::UNVOTE => Unvote::class, + self::VALIDATOR_REGISTRATION => ValidatorRegistration::class, + self::VALIDATOR_RESIGNATION => ValidatorResignation::class, + }; + } +} diff --git a/src/Enums/Fees.php b/src/Enums/Fees.php index 0d6671b8..60103812 100644 --- a/src/Enums/Fees.php +++ b/src/Enums/Fees.php @@ -22,6 +22,5 @@ class Fees public const USERNAME_RESIGNATION = '2500000000'; - // @TODO: review this fee public const EVM = '0'; } diff --git a/src/Enums/Types.php b/src/Enums/Types.php index f9fc7b46..ad1955c0 100644 --- a/src/Enums/Types.php +++ b/src/Enums/Types.php @@ -4,15 +4,6 @@ namespace ArkEcosystem\Crypto\Enums; -use ArkEcosystem\Crypto\Transactions\Types\EvmCall; -use ArkEcosystem\Crypto\Transactions\Types\MultiPayment; -use ArkEcosystem\Crypto\Transactions\Types\MultiSignatureRegistration; -use ArkEcosystem\Crypto\Transactions\Types\Transfer; -use ArkEcosystem\Crypto\Transactions\Types\UsernameRegistration; -use ArkEcosystem\Crypto\Transactions\Types\UsernameResignation; -use ArkEcosystem\Crypto\Transactions\Types\ValidatorRegistration; -use ArkEcosystem\Crypto\Transactions\Types\ValidatorResignation; -use ArkEcosystem\Crypto\Transactions\Types\Vote; use ReflectionEnum; /** @@ -30,32 +21,17 @@ enum Types: int case USERNAME_RESIGNATION = 9; case EVM_CALL = 10; - public function transactionClass(): string - { - return match ($this) { - Types::TRANSFER => Transfer::class, - Types::VALIDATOR_REGISTRATION => ValidatorRegistration::class, - Types::VOTE => Vote::class, - Types::MULTI_SIGNATURE_REGISTRATION => MultiSignatureRegistration::class, - Types::MULTI_PAYMENT => MultiPayment::class, - Types::VALIDATOR_RESIGNATION => ValidatorResignation::class, - Types::USERNAME_REGISTRATION => UsernameRegistration::class, - Types::USERNAME_RESIGNATION => UsernameResignation::class, - Types::EVM_CALL => EvmCall::class, - }; - } - public function defaultFee(): string { return match ($this) { Types::TRANSFER => Fees::TRANSFER, Types::VALIDATOR_REGISTRATION => Fees::VALIDATOR_REGISTRATION, Types::VOTE => Fees::VOTE, - Types::MULTI_SIGNATURE_REGISTRATION => Fees::MULTI_SIGNATURE_REGISTRATION, - Types::MULTI_PAYMENT => Fees::MULTI_PAYMENT, + // Types::MULTI_SIGNATURE_REGISTRATION => Fees::MULTI_SIGNATURE_REGISTRATION, + // Types::MULTI_PAYMENT => Fees::MULTI_PAYMENT, Types::VALIDATOR_RESIGNATION => Fees::VALIDATOR_RESIGNATION, - Types::USERNAME_REGISTRATION => Fees::USERNAME_REGISTRATION, - Types::USERNAME_RESIGNATION => Fees::USERNAME_RESIGNATION, + // Types::USERNAME_REGISTRATION => Fees::USERNAME_REGISTRATION, + // Types::USERNAME_RESIGNATION => Fees::USERNAME_RESIGNATION, Types::EVM_CALL => Fees::EVM, }; } diff --git a/src/Transactions/Builder/AbstractTransactionBuilder.php b/src/Transactions/Builder/AbstractTransactionBuilder.php index 9b98c73f..9937ed5e 100644 --- a/src/Transactions/Builder/AbstractTransactionBuilder.php +++ b/src/Transactions/Builder/AbstractTransactionBuilder.php @@ -6,56 +6,62 @@ use ArkEcosystem\Crypto\Configuration\Fee; use ArkEcosystem\Crypto\Configuration\Network; +use ArkEcosystem\Crypto\Enums\TypeGroup; +use ArkEcosystem\Crypto\Enums\Types; use ArkEcosystem\Crypto\Identities\PrivateKey; -use ArkEcosystem\Crypto\Transactions\Types\Transaction; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; abstract class AbstractTransactionBuilder { - public $transaction; + public AbstractTransaction $transaction; - /** - * Create a new transaction instance. - */ - public function __construct() + public function __construct(?array $data = null) { - $this->transaction = $this->getTransactionInstance(); - $this->transaction->data['type'] = $this->getType(); - $this->transaction->data['typeGroup'] = $this->getTypeGroup(); - $this->transaction->data['nonce'] = '0'; - $this->transaction->data['amount'] = '0'; - $this->transaction->data['fee'] = $this->getFee(); - $this->transaction->data['version'] = 1; - $this->transaction->data['network'] = Network::get()->pubKeyHash(); + $this->transaction = $this->getTransactionInstance(); + + $this->transaction->data = $data ?? [ + 'type' => Types::EVM_CALL->value, + 'typeGroup' => TypeGroup::CORE, + 'amount' => '0', + 'senderPublicKey' => '', + 'fee' => Fee::get(Types::EVM_CALL->value), + 'nonce' => '1', + 'version' => 1, + 'network' => Network::get()->pubKeyHash(), + 'asset' => [ + 'evmCall' => [ + 'gasLimit' => 1000000, // Default gas limit + 'payload' => '', // EVM code in hex format + ], + ], + ]; } - /** - * Convert the message to its string representation. - * - * @return string - */ - public function __toString() + public function __toString(): string { return $this->toJson(); } - /** - * Create a new transaction instance. - * - * @return AbstractTransactionBuilder - */ - public static function new(): self + public static function new(?array $data = null): static { - return new static(); + return new static($data); } - /** - * Set the transaction fee. - * - * @param string $fee - * - * @return AbstractTransactionBuilder - */ - public function withFee(string $fee): self + public function gasLimit(int $gasLimit): static + { + $this->transaction->data['asset']['evmCall']['gasLimit'] = $gasLimit; + + return $this; + } + + public function recipient(string $recipientId): static + { + $this->transaction->data['recipientId'] = $recipientId; + + return $this; + } + + public function fee(string $fee): static { $this->transaction->data['fee'] = $fee; @@ -63,41 +69,28 @@ public function withFee(string $fee): self } /** - * Set the transaction nonce. - * - * @param string $nonce - * - * @return AbstractTransactionBuilder + * Alias for fee. */ - public function withNonce(string $nonce): self + public function gasPrice(string $gasPrice): static + { + return $this->fee($gasPrice); + } + + public function nonce(string $nonce): static { $this->transaction->data['nonce'] = $nonce; return $this; } - /** - * Set the transaction network. - * - * @param int $network - * - * @return AbstractTransactionBuilder - */ - public function withNetwork(int $network): self + public function network(int $network): static { $this->transaction->data['network'] = $network; return $this; } - /** - * Sign the transaction using the given passphrase. - * - * @param string $passphrase - * - * @return AbstractTransactionBuilder - */ - public function sign(string $passphrase): self + public function sign(string $passphrase): static { $keys = PrivateKey::fromPassphrase($passphrase); $this->transaction->data['senderPublicKey'] = $keys->getPublicKey()->getHex(); @@ -108,105 +101,43 @@ public function sign(string $passphrase): self return $this; } - /** - * Sign the transaction using the given passphrase. - * - * @param string $passphrase - * - * @return AbstractTransactionBuilder - */ - public function multiSign(string $passphrase, int $index = -1): self + public function multiSign(string $passphrase, int $index = -1): static { - $keys = PrivateKey::fromPassphrase($passphrase); - + $keys = PrivateKey::fromPassphrase($passphrase); $this->transaction = $this->transaction->multiSign($keys, $index); return $this; } - /** - * Sign the transaction using the given second passphrase. - * - * @param string $secondPassphrase - * - * @return AbstractTransactionBuilder - */ - public function secondSign(string $secondPassphrase): self + public function secondSign(string $secondPassphrase): static { - $this->transaction = $this->transaction->secondSign(PrivateKey::fromPassphrase($secondPassphrase)); + $this->transaction = $this->transaction->secondSign( + PrivateKey::fromPassphrase($secondPassphrase) + ); $this->transaction->data['id'] = $this->transaction->getId(); return $this; } - /** - * Verify the transaction validity. - * - * @return bool - */ public function verify(): bool { return $this->transaction->verify(); } - /** - * Verify the transaction validity with a second signature. - * - * @return bool - */ public function secondVerify(string $secondPublicKey): bool { return $this->transaction->secondVerify($secondPublicKey); } - /** - * Convert the transaction to its array representation. - * - * @return array - */ public function toArray(): array { return $this->transaction->toArray(); } - /** - * Convert the transaction to its JSON representation. - * - * @return string - */ public function toJson(): string { return $this->transaction->toJson(); } - /** - * Get the transaction type. - * - * @return int - */ - abstract protected function getType(): int; - - /** - * Get the transaction typeGroup. - * - * @return int - */ - abstract protected function getTypeGroup(): int; - - /** - * Get the transaction instance. - * - * @return object - */ - abstract protected function getTransactionInstance(): object; - - /** - * Get the transaction fee. - * - * @return string - */ - protected function getFee(): string - { - return Fee::get($this->transaction->data['type']); - } + abstract protected function getTransactionInstance(?array $data = []): AbstractTransaction; } diff --git a/src/Transactions/Builder/EvmCallBuilder.php b/src/Transactions/Builder/EvmCallBuilder.php index a651f7f5..67fdc103 100644 --- a/src/Transactions/Builder/EvmCallBuilder.php +++ b/src/Transactions/Builder/EvmCallBuilder.php @@ -4,31 +4,11 @@ namespace ArkEcosystem\Crypto\Transactions\Builder; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Crypto\Transactions\Types\EvmCall; class EvmCallBuilder extends AbstractTransactionBuilder { - /** - * Create a new EVM call transaction instance. - */ - public function __construct() - { - parent::__construct(); - - $this->transaction->data['asset'] = [ - 'evmCall' => [ - 'gasLimit' => 1000000, // Default gas limit - 'payload' => '', // EVM code in hex format - ], - ]; - } - - /** - * Set the payload for the EVM call. - * - * @param string $payload - * @return self - */ public function payload(string $payload): self { $payload = ltrim($payload, '0x'); @@ -37,53 +17,8 @@ public function payload(string $payload): self return $this; } - /** - * Set the gas limit for the EVM call. - * - * @param int $gasLimit - * @return self - */ - public function withGasLimit(int $gasLimit): self - { - $this->transaction->data['asset']['evmCall']['gasLimit'] = $gasLimit; - - return $this; - } - - /** - * Set the recipient of the EVM call. - * - * @param string $recipientId - * @return self - */ - public function recipient(string $recipientId): self - { - $this->transaction->data['recipientId'] = $recipientId; - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::EVM_CALL->value; - } - - /** - * {@inheritdoc} - */ - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - /** - * {@inheritdoc} - */ - protected function getTransactionInstance(): object + protected function getTransactionInstance(?array $data = []): AbstractTransaction { - return new EvmCall(); + return new EvmCall($data); } } diff --git a/src/Transactions/Builder/MultiPaymentBuilder.php b/src/Transactions/Builder/MultiPaymentBuilder.php deleted file mode 100644 index 18c7a487..00000000 --- a/src/Transactions/Builder/MultiPaymentBuilder.php +++ /dev/null @@ -1,69 +0,0 @@ -transaction->data['asset'] = ['payments' => []]; - } - - /** - * Add a new payment to the collection. - * - * @param string $recipientId - * @param string $amount - * - * @return self - */ - public function add(string $recipientId, string $amount): self - { - $this->transaction->data['asset']['payments'][] = compact('recipientId', 'amount'); - - $this->transaction->data['amount'] = strval(+$this->transaction->data['amount'] + +$amount); - - return $this; - } - - /** - * Set the vendor field / smartbridge. - * - * @param string $vendorField - * - * @return self - */ - public function vendorField(string $vendorField): self - { - $this->transaction->data['vendorField'] = $vendorField; - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::MULTI_PAYMENT->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object - { - return new MultiPayment(); - } -} diff --git a/src/Transactions/Builder/MultiSignatureRegistrationBuilder.php b/src/Transactions/Builder/MultiSignatureRegistrationBuilder.php deleted file mode 100644 index 838f4d77..00000000 --- a/src/Transactions/Builder/MultiSignatureRegistrationBuilder.php +++ /dev/null @@ -1,92 +0,0 @@ -transaction->data['asset'] = ['multiSignature' => [ - 'min' => 0, - 'publicKeys' => [], - ]]; - } - - /** - * Set the minimum required signatures. - * - * @param int $min - * - * @return self - */ - public function min(int $min): self - { - $this->transaction->data['asset']['multiSignature']['min'] = $min; - - return $this; - } - - /** - * Add a participant to the multi signature registration. - * - * @param string $publicKey - * - * @return self - */ - public function participant(string $publicKey): self - { - if (Arr::get($this->transaction->data, 'asset.multiSignature.publicKeys', []) <= 16) { - $this->transaction->data['asset']['multiSignature']['publicKeys'][] = $publicKey; - } - - return $this; - } - - /** - * Set the multiSignature asset for the transaction. - * - * @param array{ - * min: int, - * publicKeys: string[] - * } $asset The multiSignature asset array containing 'min' and 'publicKeys'. - * - * @return self - */ - public function multiSignatureAsset(array $asset): self - { - Arr::set($this->transaction->data, 'asset.multiSignature', $asset); - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::MULTI_SIGNATURE_REGISTRATION->value; - } - - /** - * {@inheritdoc} - */ - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object - { - return new MultiSignatureRegistration(); - } -} diff --git a/src/Transactions/Builder/TransferBuilder.php b/src/Transactions/Builder/TransferBuilder.php index 412e4fdc..87ac03c7 100644 --- a/src/Transactions/Builder/TransferBuilder.php +++ b/src/Transactions/Builder/TransferBuilder.php @@ -4,38 +4,11 @@ namespace ArkEcosystem\Crypto\Transactions\Builder; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Crypto\Transactions\Types\Transfer; class TransferBuilder extends AbstractTransactionBuilder { - public function __construct() - { - parent::__construct(); - - $this->transaction->data['expiration'] = 0; - } - - /** - * Set the recipient of the transfer. - * - * @param string $recipientId - * - * @return self - */ - public function recipient(string $recipientId): self - { - $this->transaction->data['recipientId'] = $recipientId; - - return $this; - } - - /** - * Set the amount to transfer. - * - * @param string $amount - * - * @return self - */ public function amount(string $amount): self { $this->transaction->data['amount'] = $amount; @@ -43,35 +16,8 @@ public function amount(string $amount): self return $this; } - /** - * Set the vendor field / smartbridge. - * - * @param string $vendorField - * - * @return self - */ - public function vendorField(string $vendorField): self - { - $this->transaction->data['vendorField'] = $vendorField; - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::TRANSFER->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object + protected function getTransactionInstance(?array $data = []): AbstractTransaction { - return new Transfer(); + return new Transfer($data); } } diff --git a/src/Transactions/Builder/UnvoteBuilder.php b/src/Transactions/Builder/UnvoteBuilder.php new file mode 100644 index 00000000..7797f49e --- /dev/null +++ b/src/Transactions/Builder/UnvoteBuilder.php @@ -0,0 +1,16 @@ +transaction->data['asset'] = []; - } - - /** - * Set the username to assign. - * - * @param string $username - * - * @return self - */ - public function usernameAsset(string $username): self - { - if ($username) { - $this->transaction->data['asset']['username'] = $username; - } - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::USERNAME_REGISTRATION->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object - { - return new UsernameRegistration(); - } -} diff --git a/src/Transactions/Builder/UsernameResignationBuilder.php b/src/Transactions/Builder/UsernameResignationBuilder.php deleted file mode 100644 index 40b0fede..00000000 --- a/src/Transactions/Builder/UsernameResignationBuilder.php +++ /dev/null @@ -1,39 +0,0 @@ -value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object - { - return new UsernameResignation(); - } -} diff --git a/src/Transactions/Builder/ValidatorRegistrationBuilder.php b/src/Transactions/Builder/ValidatorRegistrationBuilder.php index 3dce4860..79fc7878 100644 --- a/src/Transactions/Builder/ValidatorRegistrationBuilder.php +++ b/src/Transactions/Builder/ValidatorRegistrationBuilder.php @@ -4,51 +4,20 @@ namespace ArkEcosystem\Crypto\Transactions\Builder; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Crypto\Transactions\Types\ValidatorRegistration; class ValidatorRegistrationBuilder extends AbstractTransactionBuilder { - /** - * Create a new delegate registration transaction instance. - */ - public function __construct() + public function validatorPublicKey(string $validatorPublicKey): self { - parent::__construct(); - - $this->transaction->data['asset'] = []; - } - - /** - * Set the username to assign. - * - * @param string $username - * - * @return self - */ - public function publicKeyAsset(string $publicKey): self - { - if ($publicKey) { - $this->transaction->data['asset']['validatorPublicKey'] = $publicKey; - } + $this->transaction->data['asset']['validatorPublicKey'] = $validatorPublicKey; return $this; } - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::VALIDATOR_REGISTRATION->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object + protected function getTransactionInstance(?array $data = []): AbstractTransaction { - return new ValidatorRegistration(); + return new ValidatorRegistration($data); } } diff --git a/src/Transactions/Builder/ValidatorResignationBuilder.php b/src/Transactions/Builder/ValidatorResignationBuilder.php index 428e8c60..4a410524 100644 --- a/src/Transactions/Builder/ValidatorResignationBuilder.php +++ b/src/Transactions/Builder/ValidatorResignationBuilder.php @@ -4,22 +4,13 @@ namespace ArkEcosystem\Crypto\Transactions\Builder; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Crypto\Transactions\Types\ValidatorResignation; class ValidatorResignationBuilder extends AbstractTransactionBuilder { - protected function getType(): int + protected function getTransactionInstance(?array $data = []): AbstractTransaction { - return \ArkEcosystem\Crypto\Enums\Types::VALIDATOR_RESIGNATION->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object - { - return new ValidatorResignation(); + return new ValidatorResignation($data); } } diff --git a/src/Transactions/Builder/VoteBuilder.php b/src/Transactions/Builder/VoteBuilder.php index 71dbc74d..bda199e7 100644 --- a/src/Transactions/Builder/VoteBuilder.php +++ b/src/Transactions/Builder/VoteBuilder.php @@ -4,81 +4,20 @@ namespace ArkEcosystem\Crypto\Transactions\Builder; -use ArkEcosystem\Crypto\Configuration\Network; -use ArkEcosystem\Crypto\Identities\Address; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Crypto\Transactions\Types\Vote; class VoteBuilder extends AbstractTransactionBuilder { - /** - * Create a new multi signature transaction instance. - */ - public function __construct() + public function vote(string $vote): self { - parent::__construct(); - - $this->transaction->data['asset'] = []; - } - - /** - * Set the votes to cast. - * - * @param array $votes - * - * @return self - */ - public function votes(array $votes): self - { - $this->transaction->data['asset']['votes'] = $votes; + $this->transaction->data['asset']['vote'] = $vote; return $this; } - /** - * Set the unvotes to cast. - * - * @param array $votes - * - * @return self - */ - public function unvotes(array $unvotes): self - { - $this->transaction->data['asset']['unvotes'] = $unvotes; - - return $this; - } - - /** - * Sign the transaction using the given passphrase. - * - * @param string $passphrase - * - * @return self - */ - public function sign(string $passphrase): AbstractTransactionBuilder - { - $this->transaction->data['recipientId'] = Address::fromPassphrase($passphrase, Network::get()); - - parent::sign($passphrase); - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function getType(): int - { - return \ArkEcosystem\Crypto\Enums\Types::VOTE->value; - } - - protected function getTypeGroup(): int - { - return \ArkEcosystem\Crypto\Enums\TypeGroup::CORE; - } - - protected function getTransactionInstance(): object + protected function getTransactionInstance(?array $data = []): AbstractTransaction { - return new Vote(); + return new Vote($data); } } diff --git a/src/Transactions/Deserializer.php b/src/Transactions/Deserializer.php index 35f5a1ea..522fb831 100644 --- a/src/Transactions/Deserializer.php +++ b/src/Transactions/Deserializer.php @@ -5,8 +5,16 @@ namespace ArkEcosystem\Crypto\Transactions; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use ArkEcosystem\Crypto\Enums\Types; -use ArkEcosystem\Crypto\Transactions\Types\Transaction; +use ArkEcosystem\Crypto\Enums\AbiFunction; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; +use ArkEcosystem\Crypto\Transactions\Types\EvmCall; +use ArkEcosystem\Crypto\Transactions\Types\Transfer; +use ArkEcosystem\Crypto\Transactions\Types\Unvote; +use ArkEcosystem\Crypto\Transactions\Types\ValidatorRegistration; +use ArkEcosystem\Crypto\Transactions\Types\ValidatorResignation; +use ArkEcosystem\Crypto\Transactions\Types\Vote; +use ArkEcosystem\Crypto\Utils\AbiDecoder; +use ArkEcosystem\Crypto\Utils\Address; use BitWasp\Bitcoin\Crypto\Hash; class Deserializer @@ -15,8 +23,6 @@ class Deserializer /** * Create a new deserializer instance. - * - * @param object $serialized */ public function __construct(string $serialized) { @@ -36,59 +42,110 @@ public static function new(string $serialized) /** * Perform AIP11 compliant deserialization. */ - public function deserialize(): Transaction + public function deserialize(): AbstractTransaction { $data = []; $this->deserializeCommon($data); - $transactionClass = Types::fromValue($data['type'])->transactionClass(); - $transaction = new $transactionClass(); - $transaction->data = $data; + // Vendor field length from previous transaction serialization + $this->buffer->skip(1); - $this->deserializeVendorField($transaction); + $this->deserializeData($data); - // Deserialize type specific parts - $transaction->deserializeData($this->buffer); + $transaction = $this->guessTransactionFromData($data); $this->deserializeSignatures($transaction->data); - if (! isset($transaction->data['amount'])) { - $transaction->data['amount'] = '0'; - } - $transaction->data['id'] = Hash::sha256($transaction->serialize())->getHex(); return $transaction; } - private function deserializeCommon(array &$data): void + private function guessTransactionFromData(array $data): AbstractTransaction { - $this->buffer->skip(1); - $data['version'] = $this->buffer->readUInt8(); - $data['network'] = $this->buffer->readUInt8(); - $data['typeGroup'] = $this->buffer->readUInt32(); - $data['type'] = $this->buffer->readUInt16(); - $data['nonce'] = strval($this->buffer->readUInt64()); - $data['senderPublicKey'] = $this->buffer->readHex(33 * 2); - - if (intval($data['type']) === Types::EVM_CALL->value) { - $data['fee'] = $this->buffer->readUInt256(); - } else { - $data['fee'] = strval($this->buffer->readUInt64()); + if ($data['amount'] !== '0') { + return new Transfer($data); } + + $payloadData = $this->decodePayload($data); + + if ($payloadData === null) { + return new EvmCall(); + } + + $functionName = $payloadData['functionName']; + + if ($functionName === AbiFunction::VOTE->value) { + return new Vote($data); + } + + if ($functionName === AbiFunction::UNVOTE->value) { + return new Unvote($data); + } + + if ($functionName === AbiFunction::VALIDATOR_REGISTRATION->value) { + return new ValidatorRegistration($data); + } + + if ($functionName === AbiFunction::VALIDATOR_RESIGNATION->value) { + return new ValidatorResignation($data); + } + + return new EvmCall(); } - private function deserializeVendorField(Transaction $transaction): void + private function decodePayload(array $data): ?array { - $vendorFieldLength = $this->buffer->readUInt8(); - if ($vendorFieldLength > 0) { - if ($transaction->hasVendorField()) { - $transaction->data['vendorField'] = $this->buffer->readHexString($vendorFieldLength * 2); - } else { - $this->buffer->skip($vendorFieldLength); - } + $payload = $data['asset']['evmCall']['payload']; + + if ($payload === '') { + return null; } + + return (new AbiDecoder())->decodeFunctionData($payload); + } + + private function deserializeData(array &$data): void + { + // Read amount (uint64) + $data['amount'] = $this->buffer->readUInt256(); + + // Read recipient marker and recipientId + $recipientMarker = $this->buffer->readUInt8(); + if ($recipientMarker === 1) { + $data['recipientId'] = Address::fromByteBuffer($this->buffer); + } + + // Read gasLimit (uint32) + $gasLimit = $this->buffer->readUInt32(); + + // Read payload length (uint32) + $payloadLength = $this->buffer->readUInt32(); + + // Read payload as hex + $payloadHex = $this->buffer->readHex($payloadLength * 2); + + $data['asset'] = [ + 'evmCall' => [ + 'gasLimit' => $gasLimit, + 'payload' => $payloadHex, + ], + ]; + } + + private function deserializeCommon(array &$data): void + { + $this->buffer->skip(1); + + $data['version'] = $this->buffer->readUInt8(); + $data['network'] = $this->buffer->readUInt8(); + $data['typeGroup'] = $this->buffer->readUInt32(); + $data['type'] = $this->buffer->readUInt16(); + $data['nonce'] = strval($this->buffer->readUInt64()); + $data['senderPublicKey'] = $this->buffer->readHex(33 * 2); + $data['fee'] = $this->buffer->readUInt256(); + $data['amount'] = '0'; } private function deserializeSignatures(array &$data): void diff --git a/src/Transactions/Serializer.php b/src/Transactions/Serializer.php index e1fb9b87..c2fb5c50 100644 --- a/src/Transactions/Serializer.php +++ b/src/Transactions/Serializer.php @@ -7,18 +7,18 @@ use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; use ArkEcosystem\Crypto\Configuration\Network; use ArkEcosystem\Crypto\Enums\TypeGroup; -use ArkEcosystem\Crypto\Enums\Types; -use ArkEcosystem\Crypto\Transactions\Types\Transaction; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; +use ArkEcosystem\Crypto\Utils\Address; use BitWasp\Buffertools\Buffer; class Serializer { - public Transaction $transaction; + public AbstractTransaction $transaction; /** * Create a new serializer instance. * - * @param Transaction $transaction + * @param AbstractTransaction $transaction */ private function __construct($transaction) { @@ -28,14 +28,14 @@ private function __construct($transaction) /** * Create a new deserializer instance. * - * @param Transaction $transaction + * @param AbstractTransaction $transaction */ public static function new($transaction) { return new static($transaction); } - public static function getBytes(Transaction $transaction, array $options = []): Buffer + public static function getBytes(AbstractTransaction $transaction, array $options = []): Buffer { return $transaction->serialize($options); } @@ -51,10 +51,11 @@ public function serialize(array $options = []): Buffer $this->serializeCommon($buffer); - $this->serializeVendorField($buffer); + // Vendor field length from previous transaction serialization + // Added for compatibility + $buffer->writeUInt8(0); - $typeBuffer = $this->transaction->serializeData($options); - $buffer->append($typeBuffer); + $this->serializeData($buffer, $options); $this->serializeSignatures($buffer, $options); @@ -89,50 +90,49 @@ public function serializeSignatures(ByteBuffer $buffer, array $options): void } } - private function serializeCommon(ByteBuffer $buffer): void + private function serializeData(ByteBuffer $buffer, array $options = []): void { - $this->transaction->data['version'] = $this->transaction->data['version'] ?? 0x01; - if (! isset($this->transaction->data['typeGroup'])) { - $this->transaction->data['typeGroup'] = TypeGroup::CORE; + // Write amount (uint256) + $buffer->writeUint256($this->transaction->data['amount']); + + // Write recipient marker and recipientId (if present) + if (isset($this->transaction->data['recipientId'])) { + $buffer->writeUInt8(1); // Recipient marker + $buffer->writeHex( + Address::toBufferHexString($this->transaction->data['recipientId']) + ); + } else { + $buffer->writeUInt8(0); // No recipient } + // Write gasLimit (uint32) + $buffer->writeUInt32($this->transaction->data['asset']['evmCall']['gasLimit']); + + // Write payload length (uint32) and payload + $payloadHex = ltrim($this->transaction->getPayload(), '0x'); + + $payloadLength = strlen($payloadHex); + + $buffer->writeUInt32($payloadLength / 2); + + // Write payload as hex + $buffer->writeHex($payloadHex); + } + + private function serializeCommon(ByteBuffer $buffer): void + { $buffer->writeUInt8(0xff); - $buffer->writeUInt8($this->transaction->data['version']); + $buffer->writeUInt8($this->transaction->data['version'] ?? 0x01); $buffer->writeUInt8($this->transaction->data['network'] ?? Network::version()); - $buffer->writeUint32($this->transaction->data['typeGroup']); + $buffer->writeUint32($this->transaction->data['typeGroup'] ?? TypeGroup::CORE); $buffer->writeUint16($this->transaction->data['type']); $buffer->writeUint64(+$this->transaction->data['nonce']); - if (isset($this->transaction->data['senderPublicKey'])) { + if ($this->transaction->data['senderPublicKey']) { $buffer->writeHex($this->transaction->data['senderPublicKey']); } - if (intval($this->transaction->data['type']) === Types::EVM_CALL->value) { - $buffer->writeUint256($this->transaction->data['fee']); - } else { - $buffer->writeUint64(+$this->transaction->data['fee']); - } - } - - private function serializeVendorField(ByteBuffer $buffer): void - { - if ($this->transaction->hasVendorField()) { - $data = $this->transaction->data; - - if (isset($data['vendorField'])) { - $vendorFieldLength = strlen($data['vendorField']); - $buffer->writeUInt8($vendorFieldLength); - $buffer->writeString($data['vendorField']); - } elseif (isset($data['vendorFieldHex'])) { - $vendorFieldHexLength = strlen($data['vendorFieldHex']); - $buffer->writeUInt8($vendorFieldHexLength / 2); - $buffer->writeHex($data['vendorFieldHex']); - } else { - $buffer->writeUInt8(0x00); - } - } else { - $buffer->writeUInt8(0x00); - } + $buffer->writeUint256($this->transaction->data['fee']); } } diff --git a/src/Transactions/Types/Transaction.php b/src/Transactions/Types/AbstractTransaction.php similarity index 83% rename from src/Transactions/Types/Transaction.php rename to src/Transactions/Types/AbstractTransaction.php index 7e4e622d..38977ffd 100644 --- a/src/Transactions/Types/Transaction.php +++ b/src/Transactions/Types/AbstractTransaction.php @@ -4,24 +4,41 @@ namespace ArkEcosystem\Crypto\Transactions\Types; -use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; use ArkEcosystem\Crypto\Configuration\Network; use ArkEcosystem\Crypto\Transactions\Serializer; +use ArkEcosystem\Crypto\Utils\AbiDecoder; use BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey; use BitWasp\Bitcoin\Crypto\Hash; use BitWasp\Buffertools\Buffer; -abstract class Transaction +abstract class AbstractTransaction { - /** - * @var object - */ - public $data; + public array $data; + + public function __construct(?array $data = null) + { + $this->data = $data ?? []; + } + + abstract public function getPayload(): string; + + public function decodePayload(array $data): ?array + { + if (! isset($data['asset']['evmCall']['payload'])) { + return null; + } + + $payload = $data['asset']['evmCall']['payload']; + + if ($payload === '') { + return null; + } + + return (new AbiDecoder())->decodeFunctionData($payload); + } /** * Convert the byte representation to a unique identifier. - * - * @return string */ public function getId(): string { @@ -35,12 +52,8 @@ public function getBytes($options = []): Buffer /** * Sign the transaction using the given passphrase. - * - * @param PrivateKey $keys - * - * @return Transaction */ - public function sign(PrivateKey $keys): self + public function sign(PrivateKey $keys): static { $options = [ 'skipSignature' => true, @@ -56,12 +69,8 @@ public function sign(PrivateKey $keys): self /** * Sign the transaction using the given second passphrase. - * - * @param PrivateKey $keys - * - * @return Transaction */ - public function secondSign(PrivateKey $keys): self + public function secondSign(PrivateKey $keys): static { $options = [ 'skipSecondSignature' => true, @@ -75,13 +84,8 @@ public function secondSign(PrivateKey $keys): self /** * Sign the transaction using the given passphrase. - * - * @param PrivateKey $keys - * @param int $index - * - * @return Transaction */ - public function multiSign(PrivateKey $keys, int $index = -1): self + public function multiSign(PrivateKey $keys, int $index = -1): static { if (! isset($this->data['signatures'])) { $this->data['signatures'] = []; @@ -136,45 +140,25 @@ public function serialize(array $options = []): Buffer return Serializer::new($this)->serialize($options); } - /** - * Perform AIP11 compliant serialization. - * - * @return ByteBuffer $buffer - */ - abstract public function serializeData(array $options = []): ByteBuffer; - - /** - * Perform AIP11 compliant deserialization. - * - * @param ByteBuffer $buffer - * - * @return void - */ - abstract public function deserializeData(ByteBuffer $buffer): void; - /** * Convert the transaction to its array representation. - * - * @return array */ public function toArray(): array { return array_filter([ - 'amount' => $this->data['amount'], - 'asset' => $this->data['asset'] ?? null, 'fee' => $this->data['fee'], 'id' => $this->data['id'], 'network' => $this->data['network'] ?? Network::get()->version(), - 'recipientId' => $this->data['recipientId'] ?? null, + 'nonce' => $this->data['nonce'], 'senderPublicKey' => $this->data['senderPublicKey'], 'signature' => $this->data['signature'], - 'signatures' => $this->data['signatures'] ?? null, - 'secondSignature' => $this->data['secondSignature'] ?? null, 'type' => $this->data['type'], 'typeGroup' => $this->data['typeGroup'], - 'nonce' => $this->data['nonce'], - 'vendorField' => $this->data['vendorField'] ?? null, 'version' => $this->data['version'] ?? 1, + 'signatures' => $this->data['signatures'] ?? null, + 'recipientId' => $this->data['recipientId'] ?? null, + 'amount' => $this->data['amount'], + 'asset' => $this->data['asset'], ], function ($element) { if (null !== $element) { return true; @@ -186,19 +170,12 @@ public function toArray(): array /** * Convert the transaction to its JSON representation. - * - * @return string */ public function toJson(): string { return json_encode($this->toArray()); } - public function hasVendorField(): bool - { - return false; - } - private function numberToHex(int $number, $padding = 2): string { // Convert the number to hexadecimal diff --git a/src/Transactions/Types/EvmCall.php b/src/Transactions/Types/EvmCall.php index 138e83d2..cf28442e 100644 --- a/src/Transactions/Types/EvmCall.php +++ b/src/Transactions/Types/EvmCall.php @@ -4,79 +4,10 @@ namespace ArkEcosystem\Crypto\Transactions\Types; -use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use ArkEcosystem\Crypto\Utils\Address; - -class EvmCall extends Transaction +class EvmCall extends AbstractTransaction { - /** - * Serialize the EVM call transaction data. - * - * @param array $options - * @return ByteBuffer - */ - public function serializeData(array $options = []): ByteBuffer - { - $buffer = ByteBuffer::new(0); - - // Write amount (uint256) - $buffer->writeUint256($this->data['amount']); - - // Write recipient marker and recipientId (if present) - if (isset($this->data['recipientId'])) { - $buffer->writeUInt8(1); // Recipient marker - $buffer->writeHex( - Address::toBufferHexString($this->data['recipientId']) - ); - } else { - $buffer->writeUInt8(0); // No recipient - } - - // Write gasLimit (uint32) - $buffer->writeUInt32($this->data['asset']['evmCall']['gasLimit']); - - // Write payload length (uint32) and payload - $payloadHex = $this->data['asset']['evmCall']['payload']; - $payloadLength = strlen($payloadHex); - - $buffer->writeUInt32($payloadLength / 2); - - // Write payload as hex - $buffer->writeHex($payloadHex); - - return $buffer; - } - - /** - * Deserialize the EVM call transaction data. - * - * @param ByteBuffer $buffer - */ - public function deserializeData(ByteBuffer $buffer): void + public function getPayload(): string { - // Read amount (uint64) - $this->data['amount'] = $buffer->readUInt256(); - - // Read recipient marker and recipientId - $recipientMarker = $buffer->readUInt8(); - if ($recipientMarker === 1) { - $this->data['recipientId'] = Address::fromByteBuffer($buffer); - } - - // Read gasLimit (uint32) - $gasLimit = $buffer->readUInt32(); - - // Read payload length (uint32) - $payloadLength = $buffer->readUInt32(); - - // Read payload as hex - $payloadHex = $buffer->readHex($payloadLength * 2); - - $this->data['asset'] = [ - 'evmCall' => [ - 'gasLimit' => $gasLimit, - 'payload' => $payloadHex, - ], - ]; + return $this->data['asset']['evmCall']['payload']; } } diff --git a/src/Transactions/Types/MultiPayment.php b/src/Transactions/Types/MultiPayment.php deleted file mode 100644 index 569c5d77..00000000 --- a/src/Transactions/Types/MultiPayment.php +++ /dev/null @@ -1,52 +0,0 @@ -writeUInt16(count($this->data['asset']['payments'])); - - foreach ($this->data['asset']['payments'] as $payment) { - $buffer->writeUInt64(+$payment['amount']); - $buffer->writeHex( - Address::toBufferHexString($payment['recipientId']) - ); - } - - return $buffer; - } - - public function deserializeData(ByteBuffer $buffer): void - { - $this->data['asset'] = ['payments' => []]; - - $count = $buffer->readUInt16(); - - for ($i = 0; $i < $count; $i++) { - $this->data['asset']['payments'][] = [ - 'amount' => strval($buffer->readUInt64()), - 'recipientId' => Address::fromByteBuffer($buffer), - ]; - } - - $this->data['amount'] = strval(array_sum(array_column($this->data['asset']['payments'], 'amount'))); - } - - public function hasVendorField(): bool - { - return true; - } -} diff --git a/src/Transactions/Types/MultiSignatureRegistration.php b/src/Transactions/Types/MultiSignatureRegistration.php deleted file mode 100644 index 460b550d..00000000 --- a/src/Transactions/Types/MultiSignatureRegistration.php +++ /dev/null @@ -1,42 +0,0 @@ -writeUInt8($this->data['asset']['multiSignature']['min']); - $buffer->writeUInt8(count($this->data['asset']['multiSignature']['publicKeys'])); - - foreach ($this->data['asset']['multiSignature']['publicKeys'] as $publicKey) { - $buffer->writeHex($publicKey); - } - - return $buffer; - } - - public function deserializeData(ByteBuffer $buffer): void - { - $asset = [ - 'multiSignature' => [ - 'min' => $buffer->readUInt8(), - 'publicKeys' => [], - ], - ]; - - $publicKeysCount = $buffer->readUInt8(); - - for ($i = 0; $i < $publicKeysCount; $i++) { - $asset['multiSignature']['publicKeys'][] = $buffer->readHex(33 * 2); - } - - $this->data['asset'] = $asset; - } -} diff --git a/src/Transactions/Types/Transfer.php b/src/Transactions/Types/Transfer.php index 7fcc8f29..7c63baad 100644 --- a/src/Transactions/Types/Transfer.php +++ b/src/Transactions/Types/Transfer.php @@ -4,35 +4,10 @@ namespace ArkEcosystem\Crypto\Transactions\Types; -use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use ArkEcosystem\Crypto\Utils\Address; - -class Transfer extends Transaction +class Transfer extends AbstractTransaction { - public function serializeData(array $options = []): ByteBuffer - { - $buffer = ByteBuffer::new(24); - - $buffer->writeUInt64(+$this->data['amount']); - - $buffer->writeUInt32($this->data['expiration'] ?? 0); - - $buffer->writeHex(Address::toBufferHexString($this->data['recipientId'])); - - return $buffer; - } - - public function deserializeData(ByteBuffer $buffer): void - { - $this->data['amount'] = strval($buffer->readUInt64()); - - $this->data['expiration'] = $buffer->readUInt32(); - - $this->data['recipientId'] = Address::fromByteBuffer($buffer); - } - - public function hasVendorField(): bool + public function getPayload(): string { - return true; + return ''; } } diff --git a/src/Transactions/Types/Unvote.php b/src/Transactions/Types/Unvote.php new file mode 100644 index 00000000..c6a717e2 --- /dev/null +++ b/src/Transactions/Types/Unvote.php @@ -0,0 +1,16 @@ +encodeFunctionCall(AbiFunction::UNVOTE->value); + } +} diff --git a/src/Transactions/Types/UsernameRegistration.php b/src/Transactions/Types/UsernameRegistration.php deleted file mode 100644 index 38f41484..00000000 --- a/src/Transactions/Types/UsernameRegistration.php +++ /dev/null @@ -1,34 +0,0 @@ -data['asset']['username']; - - $buffer->writeUint8(strlen($username)); - $buffer->writeString($username); - - return $buffer; - } - - public function deserializeData(ByteBuffer $buffer): void - { - $usernameLength = $buffer->readUint8(); - - $this->data['asset'] = [ - 'username' => $buffer->readString($usernameLength), - ]; - } -} diff --git a/src/Transactions/Types/UsernameResignation.php b/src/Transactions/Types/UsernameResignation.php deleted file mode 100644 index 0b9b7a9f..00000000 --- a/src/Transactions/Types/UsernameResignation.php +++ /dev/null @@ -1,22 +0,0 @@ -writeHex($this->data['asset']['validatorPublicKey']); + $payload = $this->decodePayload($data); - return $buffer; + if ($payload !== null) { + $data['asset']['validatorPublicKey'] = $payload['args'][0]; + } + + parent::__construct($data); } - public function deserializeData(ByteBuffer $buffer): void + public function getPayload(): string { - $this->data['asset'] = [ - 'validatorPublicKey' => $buffer->readHex(48 * 2), - ]; + return (new AbiEncoder())->encodeFunctionCall(AbiFunction::VALIDATOR_REGISTRATION->value, [$this->data['asset']['validatorPublicKey']]); } } diff --git a/src/Transactions/Types/ValidatorResignation.php b/src/Transactions/Types/ValidatorResignation.php index 80332f30..14a2c24c 100644 --- a/src/Transactions/Types/ValidatorResignation.php +++ b/src/Transactions/Types/ValidatorResignation.php @@ -4,16 +4,13 @@ namespace ArkEcosystem\Crypto\Transactions\Types; -use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; +use ArkEcosystem\Crypto\Enums\AbiFunction; +use ArkEcosystem\Crypto\Utils\AbiEncoder; -class ValidatorResignation extends Transaction +class ValidatorResignation extends AbstractTransaction { - public function serializeData(array $options = []): ByteBuffer - { - return ByteBuffer::new(0); - } - - public function deserializeData(ByteBuffer $buffer): void + public function getPayload(): string { + return (new AbiEncoder())->encodeFunctionCall(AbiFunction::VALIDATOR_RESIGNATION->value); } } diff --git a/src/Transactions/Types/Vote.php b/src/Transactions/Types/Vote.php index 61ed67eb..a0cb0868 100644 --- a/src/Transactions/Types/Vote.php +++ b/src/Transactions/Types/Vote.php @@ -4,50 +4,24 @@ namespace ArkEcosystem\Crypto\Transactions\Types; -use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; +use ArkEcosystem\Crypto\Enums\AbiFunction; +use ArkEcosystem\Crypto\Utils\AbiEncoder; -class Vote extends Transaction +class Vote extends AbstractTransaction { - public function serializeData(array $options = []): ByteBuffer + public function __construct(?array $data = []) { - $buffer = ByteBuffer::new(24); + $payload = $this->decodePayload($data); - $votes = array_key_exists('votes', $this->data['asset']) ? $this->data['asset']['votes'] : []; - $unvotes = array_key_exists('unvotes', $this->data['asset']) ? $this->data['asset']['unvotes'] : []; - - $buffer->writeUInt8(count($votes)); - $buffer->writeHex(implode('', $votes)); - - $buffer->writeUInt8(count($unvotes)); - $buffer->writeHex(implode('', $unvotes)); + if ($payload !== null) { + $data['asset']['vote'] = $payload['args'][0]; + } - return $buffer; + parent::__construct($data); } - public function deserializeData(ByteBuffer $buffer): void + public function getPayload(): string { - $voteLength = $buffer->readUInt8(); - - if ($voteLength > 0) { - $this->data['asset']['votes'] = []; - - for ($i = 0; $i < $voteLength; $i++) { - $vote = $buffer->readHex(66); - - $this->data['asset']['votes'][] = $vote; - } - } - - $unvoteLength = $buffer->readUInt8(); - - if ($unvoteLength > 0) { - $this->data['asset']['unvotes'] = []; - - for ($i = 0; $i < $unvoteLength; $i++) { - $unvote = $buffer->readHex(66); - - $this->data['asset']['unvotes'][] = $unvote; - } - } + return (new AbiEncoder())->encodeFunctionCall(AbiFunction::VOTE->value, [$this->data['asset']['vote']]); } } diff --git a/src/Utils/Abi.Consensus.json b/src/Utils/Abi.Consensus.json new file mode 100644 index 00000000..0063730c --- /dev/null +++ b/src/Utils/Abi.Consensus.json @@ -0,0 +1,814 @@ +{ + "abi": [ + { + "type": "constructor", + "inputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "activeValidatorsCount", + "inputs": [], + "outputs": [ + { "name": "", "type": "uint256", "internalType": "uint256" } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "calculateTopValidators", + "inputs": [ + { "name": "n", "type": "uint8", "internalType": "uint8" } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getAllValidators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "tuple[]", + "internalType": "struct Validator[]", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "tuple", + "internalType": "struct ValidatorData", + "components": [ + { + "name": "votersCount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voteBalance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isResigned", + "type": "bool", + "internalType": "bool" + }, + { + "name": "bls12_381_public_key", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getTopValidators", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "tuple[]", + "internalType": "struct Validator[]", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "tuple", + "internalType": "struct ValidatorData", + "components": [ + { + "name": "votersCount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voteBalance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isResigned", + "type": "bool", + "internalType": "bool" + }, + { + "name": "bls12_381_public_key", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getValidator", + "inputs": [ + { + "name": "_addr", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "tuple", + "internalType": "struct Validator", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "tuple", + "internalType": "struct ValidatorData", + "components": [ + { + "name": "votersCount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voteBalance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isResigned", + "type": "bool", + "internalType": "bool" + }, + { + "name": "bls12_381_public_key", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "isValidatorRegistered", + "inputs": [ + { "name": "addr", "type": "address", "internalType": "address" } + ], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], + "stateMutability": "view" + }, + { + "type": "function", + "name": "registerValidator", + "inputs": [ + { + "name": "bls12_381_public_key", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "registeredValidatorsCount", + "inputs": [], + "outputs": [ + { "name": "", "type": "uint256", "internalType": "uint256" } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "resignValidator", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "resignedValidatorsCount", + "inputs": [], + "outputs": [ + { "name": "", "type": "uint256", "internalType": "uint256" } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "unvote", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateValidator", + "inputs": [ + { + "name": "_validator", + "type": "tuple", + "internalType": "struct Validator", + "components": [ + { + "name": "addr", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "tuple", + "internalType": "struct ValidatorData", + "components": [ + { + "name": "votersCount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "voteBalance", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "isResigned", + "type": "bool", + "internalType": "bool" + }, + { + "name": "bls12_381_public_key", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateVoters", + "inputs": [ + { + "name": "voters", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vote", + "inputs": [ + { "name": "addr", "type": "address", "internalType": "address" } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "Unvoted", + "inputs": [ + { + "name": "voter", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "validator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ValidatorRegistered", + "inputs": [ + { + "name": "addr", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "bls12_381_public_key", + "type": "bytes", + "indexed": false, + "internalType": "bytes" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ValidatorResigned", + "inputs": [ + { + "name": "addr", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Voted", + "inputs": [ + { + "name": "voter", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "validator", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + } + ], + "bytecode": { + "object": "0x60a06040525f5f555f6001555f6009553480156019575f5ffd5b503360805260805161230c61004b5f395f818161036801528181610548015281816108be0152610ccd015261230c5ff3fe608060405234801561000f575f5ffd5b50600436106100e5575f3560e01c80636dd7d8ea11610088578063b85f5da211610063578063b85f5da2146101a6578063d04a68c7146101ae578063f1bd0b37146101e9578063f3513a37146101f0575f5ffd5b80636dd7d8ea1461016b578063afeea1151461017e578063b5cfa68c14610193575f5ffd5b80632bdf6d43116100c35780632bdf6d43146101285780633174b6891461013d578063602a9eee146101455780636252587914610158575f5ffd5b80630777cbef146100e95780630d2bd909146101005780631904bb2e14610108575b5f5ffd5b6001545b6040519081526020015b60405180910390f35b600a546100ed565b61011b610116366004611cf6565b6101f8565b6040516100f79190611da7565b61013b610136366004611db9565b61035d565b005b61013b61041b565b61013b610153366004611e2a565b61053e565b61013b610166366004611e88565b610819565b61013b610179366004611cf6565b6108b4565b610186610b24565b6040516100f79190611ebf565b61013b6101a1366004611f22565b610cc2565b61013b611115565b6101d96101bc366004611cf6565b6001600160a01b03165f9081526003602052604090205460ff1690565b60405190151581526020016100f7565b5f546100ed565b610186611236565b610200611c1b565b6001600160a01b0382165f9081526003602052604090205460ff1661026c5760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f724461746120646f65736e2774206578697374730000000060448201526064015b60405180910390fd5b6040805180820182526001600160a01b0384168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff161515948201949094526003840180549394928501939192916060840191906102d490611f42565b80601f016020809104026020016040519081016040528092919081815260200182805461030090611f42565b801561034b5780601f106103225761010080835404028352916020019161034b565b820191905f5260205f20905b81548152906001019060200180831161032e57829003601f168201915b50505091909252505050905292915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103d55760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f742074686520636f6e7472616374206f776e65726044820152606401610263565b5f5b818110156104165761040e8383838181106103f4576103f4611f74565b90506020020160208101906104099190611cf6565b6113ce565b6001016103d7565b505050565b335f90815260066020526040902080546001600160a01b03166104725760405162461bcd60e51b815260206004820152600f60248201526e1513d113ce881b9bdd081d9bdd1959608a1b6044820152606401610263565b8054604080513381526001600160a01b0390921660208301527f6572af8bf9a0a86efb88dcc30011626a15c9c4603503aa4466a3f87a1867deef910160405180910390a160018082015482546001600160a01b03165f9081526002602052604081209092018054919290916104e8908490611f9c565b909155505080546001600160a01b03165f908152600260205260408120805460019290610516908490611f9c565b9091555050335f90815260066020526040812080546001600160a01b03191681556001015550565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105b65760405162461bcd60e51b815260206004820152601c60248201527f43616c6c65722069732074686520636f6e7472616374206f776e6572000000006044820152606401610263565b335f9081526003602052604090205460ff16156106155760405162461bcd60e51b815260206004820152601f60248201527f56616c696461746f7220697320616c72656164792072656769737465726564006044820152606401610263565b5f8282604051610626929190611faf565b60408051918290039091205f8181526004602052919091205490915060ff161561069e5760405162461bcd60e51b815260206004820152602360248201527f424c5331322d333831206b657920697320616c726561647920726567697374656044820152621c995960ea1b6064820152608401610263565b6106a883836114ae565b5f60405180608001604052805f81526020015f81526020015f1515815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920182905250939094525050805492935090508061071083611fbe565b9091555050335f9081526003602081815260408084208054600160ff1991821681179092556002808552958390208751815593870151918401919091559085015193820180549091169315159390931790925560608301518392918201906107789082612035565b5050505f82815260046020526040808220805460ff191660019081179091556005805491820181559092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090910180546001600160a01b0319163390811790915590517f61809fa303a3a57f4d70552f533f3e0b003173d424590cd4bb22a2afe000990c9161080b91879087906120f0565b60405180910390a150505050565b6108296101bc6020830183611cf6565b6108755760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f724461746120646f65736e277420657869737473000000006044820152606401610263565b610882602082018261212f565b60025f6108926020850185611cf6565b6001600160a01b0316815260208101919091526040015f206104168282612207565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361092c5760405162461bcd60e51b815260206004820152601c60248201527f43616c6c65722069732074686520636f6e7472616374206f776e6572000000006044820152606401610263565b6001600160a01b0381165f9081526003602052604090205460ff166109935760405162461bcd60e51b815260206004820152601760248201527f4d75737420766f746520666f722076616c696461746f720000000000000000006044820152606401610263565b335f908152600660205260409020546001600160a01b0316156109e85760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481d9bdd1959609a1b6044820152606401610263565b6001600160a01b0381165f9081526002602081905260409091209081015460ff1615610a615760405162461bcd60e51b815260206004820152602260248201527f4d75737420766f746520666f7220756e72657369676e65642076616c6964617460448201526137b960f11b6064820152608401610263565b6040805180820182526001600160a01b03848116825233803160208085019182525f8381526006909152948520935184546001600160a01b0319169316929092178355905160019283015590830180549131929091610ac190849061228f565b9091555050805460019082905f90610ada90849061228f565b9091555050604080513381526001600160a01b03841660208201527fce0c7a2a940807f7dc2ce7a615c2532e915e6c0ac9a08bc4ed9d515a710a53e2910160405180910390a15050565b600a546060905f9067ffffffffffffffff811115610b4457610b44611fd6565b604051908082528060200260200182016040528015610b7d57816020015b610b6a611c1b565b815260200190600190039081610b625790505b5090505f5b600a54811015610cbc575f600a8281548110610ba057610ba0611f74565b5f9182526020808320909101546001600160a01b03168083526002808352604093849020845180860186528381528551608081018752825481526001830154818701529282015460ff1615159583019590955260038101805493965090949384019285916060840191610c1290611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3e90611f42565b8015610c895780601f10610c6057610100808354040283529160200191610c89565b820191905f5260205f20905b815481529060010190602001808311610c6c57829003601f168201915b505050505081525050815250848481518110610ca757610ca7611f74565b60209081029190910101525050600101610b82565b50919050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d3a5760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f742074686520636f6e7472616374206f776e65726044820152606401610263565b610d42611510565b610d4a61165f565b600780546001600160a01b03191690556001545f80549091610d7c9160ff8516918491610d779190611f9c565b6116b0565b90508060ff165f03610d8c575050565b5f5b600554811015611037575f60058281548110610dac57610dac611f74565b5f9182526020808320909101546001600160a01b03168083526002918290526040909220908101549192509060ff1615610de757505061102f565b6007546001600160a01b0316610e225750600780546001600160a01b0319166001600160a01b0392909216919091179055600160095561102f565b8360ff166009541015610e4057610e398285611741565b505061102f565b6007546001600160a01b039081165f908152600260208181526040928390208351808501855294871685528351608081018552865481526001870154818401529286015460ff16151593830193909352600385018054939461101c94909392840192918791606084019190610eb490611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610ee090611f42565b8015610f2b5780601f10610f0257610100808354040283529160200191610f2b565b820191905f5260205f20905b815481529060010190602001808311610f0e57829003601f168201915b5050509190925250505090526040805180820182526007546001600160a01b031681528151608081018352855481526001860154602082810191909152600287015460ff16151593820193909352600386018054929384019287916060840191610f9490611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc090611f42565b801561100b5780601f10610fe25761010080835404028352916020019161100b565b820191905f5260205f20905b815481529060010190602001808311610fee57829003601f168201915b505050505081525050815250611b20565b1561102b5761102b8386611741565b5050505b600101610d8e565b506007546001600160a01b031661104f600a5f611c64565b8160ff1667ffffffffffffffff81111561106b5761106b611fd6565b604051908082528060200260200182016040528015611094578160200160208202803683370190505b5080516110a991600a91602090910190611c7f565b505f5b8260ff1681101561110e5781600a82815481106110cb576110cb611f74565b5f91825260208083209190910180546001600160a01b0319166001600160a01b0394851617905593821681526008909352604090922054909116906001016110ac565b5050505b50565b335f9081526003602052604090205460ff166111735760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420612076616c696461746f72000000000000006044820152606401610263565b335f9081526002602081905260409091209081015460ff16156111d85760405162461bcd60e51b815260206004820152601d60248201527f56616c696461746f7220697320616c72656164792072657369676e65640000006044820152606401610263565b60028101805460ff19166001908117909155805481905f906111fb90839061228f565b90915550506040513381527f24250fc1ec78a1405ddd4cc8b75964858af228d05faa8d4bc1302966d8a541179060200160405180910390a150565b6005546060905f9067ffffffffffffffff81111561125657611256611fd6565b60405190808252806020026020018201604052801561128f57816020015b61127c611c1b565b8152602001906001900390816112745790505b5090505f5b600554811015610cbc575f600582815481106112b2576112b2611f74565b5f9182526020808320909101546001600160a01b03168083526002808352604093849020845180860186528381528551608081018752825481526001830154818701529282015460ff161515958301959095526003810180549396509094938401928591606084019161132490611f42565b80601f016020809104026020016040519081016040528092919081815260200182805461135090611f42565b801561139b5780601f106113725761010080835404028352916020019161139b565b820191905f5260205f20905b81548152906001019060200180831161137e57829003601f168201915b5050505050815250508152508484815181106113b9576113b9611f74565b60209081029190910101525050600101611294565b6001600160a01b038082165f90815260066020526040902080549091166113f3575050565b60018101546001600160a01b038316318110156114545761141e816001600160a01b03851631611f9c565b82546001600160a01b03165f908152600260205260408120600101805490919061144990849061228f565b909155506114999050565b6114686001600160a01b0384163182611f9c565b82546001600160a01b03165f9081526002602052604081206001018054909190611493908490611f9c565b90915550505b506001600160a01b0390911631600190910155565b6030811461150c5760405162461bcd60e51b815260206004820152602560248201527f424c5331322d333831207075626c69634b6579206c656e67746820697320696e6044820152641d985b1a5960da1b6064820152608401610263565b5050565b6005545f61151f600183611f9c565b90505b801561150c575f61153482600161228f565b60408051426020820152449181019190915260608101849052608001604051602081830303815290604052805190602001205f1c61157291906122a2565b90505f6005838154811061158857611588611f74565b5f91825260209091200154600580546001600160a01b03909216925090839081106115b5576115b5611f74565b5f91825260209091200154600580546001600160a01b0390921691859081106115e0576115e0611f74565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550806005838154811061161f5761161f611f74565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555050508080611657906122c1565b915050611522565b6007546001600160a01b03165b6001600160a01b038116156116a9576001600160a01b039081165f90815260086020526040902080546001600160a01b031981169091551661166c565b505f600955565b5f818311156117195760405162461bcd60e51b815260206004820152602f60248201527f4d696e696d756d2073686f756c64206265206c657373207468616e206f72206560448201526e7175616c20746f206d6178696d756d60881b6064820152608401610263565b8284101561172857508161173a565b8184111561173757508061173a565b50825b9392505050565b6001600160a01b0382165f9081526002602081815260408084208151608081018352815481526001820154938101939093529283015460ff1615159082015260038201805491929160608401919061179890611f42565b80601f01602080910402602001604051908101604052809291908181526020018280546117c490611f42565b801561180f5780601f106117e65761010080835404028352916020019161180f565b820191905f5260205f20905b8154815290600101906020018083116117f257829003601f168201915b5050509190925250506040805180820182526007546001600160a01b03168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff16151594820194909452600384018054969750611930969395509185019390929091606084019161188a90611f42565b80601f01602080910402602001604051908101604052809291908181526020018280546118b690611f42565b80156119015780601f106118d857610100808354040283529160200191611901565b820191905f5260205f20905b8154815290600101906020018083116118e457829003601f168201915b5050505050815250508152506040518060400160405280866001600160a01b0316815260200184815250611b20565b156119435761193e83611b6c565b611ac1565b6007546001600160a01b039081165f81815260086020526040902054909116905b6001600160a01b0382166119815761197c8186611bbd565b611abe565b6040805180820182526001600160a01b0384168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff16151594820194909452600384018054611a8e95938501939160608401916119e890611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1490611f42565b8015611a5f5780601f10611a3657610100808354040283529160200191611a5f565b820191905f5260205f20905b815481529060010190602001808311611a4257829003601f168201915b5050505050815250508152506040518060400160405280886001600160a01b0316815260200186815250611b20565b15611a9d5761197c8186611bbd565b506001600160a01b038082165f908152600860205260409020541690611964565b50505b8160ff16600954111561041657600780546001600160a01b039081165f90815260086020526040812080546001600160a01b03198082169092558454931692168217909255600980549192611b15836122c1565b919050555050505050565b5f81602001516020015183602001516020015103611b505750805182516001600160a01b03918216911611611b66565b8160200151602001518360200151602001511190505b92915050565b600780546001600160a01b038381165f8181526008602052604081208054939094166001600160a01b0319938416179093558354909116179091556009805491611bb583611fbe565b919050555050565b6001600160a01b038281165f8181526008602052604080822080548686168085529284208054919096166001600160a01b031991821617909555928252825490931690921790556009805491611c1283611fbe565b91905055505050565b60405180604001604052805f6001600160a01b03168152602001611c5f60405180608001604052805f81526020015f81526020015f15158152602001606081525090565b905290565b5080545f8255905f5260205f20908101906111129190611ce2565b828054828255905f5260205f20908101928215611cd2579160200282015b82811115611cd257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611c9d565b50611cde929150611ce2565b5090565b5b80821115611cde575f8155600101611ce3565b5f60208284031215611d06575f5ffd5b81356001600160a01b038116811461173a575f5ffd5b60018060a01b0381511682525f602082015160406020850152805160408501526020810151606085015260408101511515608085015260608101519050608060a085015280518060c08601525f5b81811015611d8757602081840181015160e0888401015201611d6a565b505f60e0828701015260e0601f19601f8301168601019250505092915050565b602081525f61173a6020830184611d1c565b5f5f60208385031215611dca575f5ffd5b823567ffffffffffffffff811115611de0575f5ffd5b8301601f81018513611df0575f5ffd5b803567ffffffffffffffff811115611e06575f5ffd5b8560208260051b8401011115611e1a575f5ffd5b6020919091019590945092505050565b5f5f60208385031215611e3b575f5ffd5b823567ffffffffffffffff811115611e51575f5ffd5b8301601f81018513611e61575f5ffd5b803567ffffffffffffffff811115611e77575f5ffd5b856020828401011115611e1a575f5ffd5b5f60208284031215611e98575f5ffd5b813567ffffffffffffffff811115611eae575f5ffd5b82016040818503121561173a575f5ffd5b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b82811015611f1657603f19878603018452611f01858351611d1c565b94506020938401939190910190600101611ee5565b50929695505050505050565b5f60208284031215611f32575f5ffd5b813560ff8116811461173a575f5ffd5b600181811c90821680611f5657607f821691505b602082108103610cbc57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115611b6657611b66611f88565b818382375f9101908152919050565b5f60018201611fcf57611fcf611f88565b5060010190565b634e487b7160e01b5f52604160045260245ffd5b601f82111561041657805f5260205f20601f840160051c8101602085101561200f5750805b601f840160051c820191505b8181101561202e575f815560010161201b565b5050505050565b815167ffffffffffffffff81111561204f5761204f611fd6565b6120638161205d8454611f42565b84611fea565b6020601f821160018114612095575f831561207e5750848201515b5f19600385901b1c1916600184901b17845561202e565b5f84815260208120601f198516915b828110156120c457878501518255602094850194600190920191016120a4565b50848210156120e157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b03841681526040602082018190528101829052818360608301375f818301606090810191909152601f909201601f1916010192915050565b5f8235607e19833603018112612143575f5ffd5b9190910192915050565b67ffffffffffffffff83111561216557612165611fd6565b612179836121738354611f42565b83611fea565b5f601f8411600181146121aa575f85156121935750838201355b5f19600387901b1c1916600186901b17835561202e565b5f83815260208120601f198716915b828110156121d957868501358255602094850194600190920191016121b9565b50868210156121f5575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813581556020820135600182015560028101604083013580151580821461222c575f5ffd5b60ff19835416915060ff8116821783555050506060820135601e19833603018112612255575f5ffd5b8201803567ffffffffffffffff81111561226d575f5ffd5b602082019150803603821315612281575f5ffd5b61110e81836003860161214d565b80820180821115611b6657611b66611f88565b5f826122bc57634e487b7160e01b5f52601260045260245ffd5b500690565b5f816122cf576122cf611f88565b505f19019056fea2646970667358221220fb596a899783aa169bc4bac8389b7b024606b59ed939dfa3029105b691e2bc1964736f6c634300081b0033", + "sourceMap": "1326:9070:23:-:0;;;1421:1;1376:46;;1468:1;1425:44;;1858:1;1820:39;;1908:41;;;;;;;;;-1:-1:-1;1935:10:23;1926:19;;1326:9070;;;;;;;;;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x608060405234801561000f575f5ffd5b50600436106100e5575f3560e01c80636dd7d8ea11610088578063b85f5da211610063578063b85f5da2146101a6578063d04a68c7146101ae578063f1bd0b37146101e9578063f3513a37146101f0575f5ffd5b80636dd7d8ea1461016b578063afeea1151461017e578063b5cfa68c14610193575f5ffd5b80632bdf6d43116100c35780632bdf6d43146101285780633174b6891461013d578063602a9eee146101455780636252587914610158575f5ffd5b80630777cbef146100e95780630d2bd909146101005780631904bb2e14610108575b5f5ffd5b6001545b6040519081526020015b60405180910390f35b600a546100ed565b61011b610116366004611cf6565b6101f8565b6040516100f79190611da7565b61013b610136366004611db9565b61035d565b005b61013b61041b565b61013b610153366004611e2a565b61053e565b61013b610166366004611e88565b610819565b61013b610179366004611cf6565b6108b4565b610186610b24565b6040516100f79190611ebf565b61013b6101a1366004611f22565b610cc2565b61013b611115565b6101d96101bc366004611cf6565b6001600160a01b03165f9081526003602052604090205460ff1690565b60405190151581526020016100f7565b5f546100ed565b610186611236565b610200611c1b565b6001600160a01b0382165f9081526003602052604090205460ff1661026c5760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f724461746120646f65736e2774206578697374730000000060448201526064015b60405180910390fd5b6040805180820182526001600160a01b0384168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff161515948201949094526003840180549394928501939192916060840191906102d490611f42565b80601f016020809104026020016040519081016040528092919081815260200182805461030090611f42565b801561034b5780601f106103225761010080835404028352916020019161034b565b820191905f5260205f20905b81548152906001019060200180831161032e57829003601f168201915b50505091909252505050905292915050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103d55760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f742074686520636f6e7472616374206f776e65726044820152606401610263565b5f5b818110156104165761040e8383838181106103f4576103f4611f74565b90506020020160208101906104099190611cf6565b6113ce565b6001016103d7565b505050565b335f90815260066020526040902080546001600160a01b03166104725760405162461bcd60e51b815260206004820152600f60248201526e1513d113ce881b9bdd081d9bdd1959608a1b6044820152606401610263565b8054604080513381526001600160a01b0390921660208301527f6572af8bf9a0a86efb88dcc30011626a15c9c4603503aa4466a3f87a1867deef910160405180910390a160018082015482546001600160a01b03165f9081526002602052604081209092018054919290916104e8908490611f9c565b909155505080546001600160a01b03165f908152600260205260408120805460019290610516908490611f9c565b9091555050335f90815260066020526040812080546001600160a01b03191681556001015550565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036105b65760405162461bcd60e51b815260206004820152601c60248201527f43616c6c65722069732074686520636f6e7472616374206f776e6572000000006044820152606401610263565b335f9081526003602052604090205460ff16156106155760405162461bcd60e51b815260206004820152601f60248201527f56616c696461746f7220697320616c72656164792072656769737465726564006044820152606401610263565b5f8282604051610626929190611faf565b60408051918290039091205f8181526004602052919091205490915060ff161561069e5760405162461bcd60e51b815260206004820152602360248201527f424c5331322d333831206b657920697320616c726561647920726567697374656044820152621c995960ea1b6064820152608401610263565b6106a883836114ae565b5f60405180608001604052805f81526020015f81526020015f1515815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920182905250939094525050805492935090508061071083611fbe565b9091555050335f9081526003602081815260408084208054600160ff1991821681179092556002808552958390208751815593870151918401919091559085015193820180549091169315159390931790925560608301518392918201906107789082612035565b5050505f82815260046020526040808220805460ff191660019081179091556005805491820181559092527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db090910180546001600160a01b0319163390811790915590517f61809fa303a3a57f4d70552f533f3e0b003173d424590cd4bb22a2afe000990c9161080b91879087906120f0565b60405180910390a150505050565b6108296101bc6020830183611cf6565b6108755760405162461bcd60e51b815260206004820152601c60248201527f56616c696461746f724461746120646f65736e277420657869737473000000006044820152606401610263565b610882602082018261212f565b60025f6108926020850185611cf6565b6001600160a01b0316815260208101919091526040015f206104168282612207565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361092c5760405162461bcd60e51b815260206004820152601c60248201527f43616c6c65722069732074686520636f6e7472616374206f776e6572000000006044820152606401610263565b6001600160a01b0381165f9081526003602052604090205460ff166109935760405162461bcd60e51b815260206004820152601760248201527f4d75737420766f746520666f722076616c696461746f720000000000000000006044820152606401610263565b335f908152600660205260409020546001600160a01b0316156109e85760405162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481d9bdd1959609a1b6044820152606401610263565b6001600160a01b0381165f9081526002602081905260409091209081015460ff1615610a615760405162461bcd60e51b815260206004820152602260248201527f4d75737420766f746520666f7220756e72657369676e65642076616c6964617460448201526137b960f11b6064820152608401610263565b6040805180820182526001600160a01b03848116825233803160208085019182525f8381526006909152948520935184546001600160a01b0319169316929092178355905160019283015590830180549131929091610ac190849061228f565b9091555050805460019082905f90610ada90849061228f565b9091555050604080513381526001600160a01b03841660208201527fce0c7a2a940807f7dc2ce7a615c2532e915e6c0ac9a08bc4ed9d515a710a53e2910160405180910390a15050565b600a546060905f9067ffffffffffffffff811115610b4457610b44611fd6565b604051908082528060200260200182016040528015610b7d57816020015b610b6a611c1b565b815260200190600190039081610b625790505b5090505f5b600a54811015610cbc575f600a8281548110610ba057610ba0611f74565b5f9182526020808320909101546001600160a01b03168083526002808352604093849020845180860186528381528551608081018752825481526001830154818701529282015460ff1615159583019590955260038101805493965090949384019285916060840191610c1290611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3e90611f42565b8015610c895780601f10610c6057610100808354040283529160200191610c89565b820191905f5260205f20905b815481529060010190602001808311610c6c57829003601f168201915b505050505081525050815250848481518110610ca757610ca7611f74565b60209081029190910101525050600101610b82565b50919050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d3a5760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f742074686520636f6e7472616374206f776e65726044820152606401610263565b610d42611510565b610d4a61165f565b600780546001600160a01b03191690556001545f80549091610d7c9160ff8516918491610d779190611f9c565b6116b0565b90508060ff165f03610d8c575050565b5f5b600554811015611037575f60058281548110610dac57610dac611f74565b5f9182526020808320909101546001600160a01b03168083526002918290526040909220908101549192509060ff1615610de757505061102f565b6007546001600160a01b0316610e225750600780546001600160a01b0319166001600160a01b0392909216919091179055600160095561102f565b8360ff166009541015610e4057610e398285611741565b505061102f565b6007546001600160a01b039081165f908152600260208181526040928390208351808501855294871685528351608081018552865481526001870154818401529286015460ff16151593830193909352600385018054939461101c94909392840192918791606084019190610eb490611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610ee090611f42565b8015610f2b5780601f10610f0257610100808354040283529160200191610f2b565b820191905f5260205f20905b815481529060010190602001808311610f0e57829003601f168201915b5050509190925250505090526040805180820182526007546001600160a01b031681528151608081018352855481526001860154602082810191909152600287015460ff16151593820193909352600386018054929384019287916060840191610f9490611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc090611f42565b801561100b5780601f10610fe25761010080835404028352916020019161100b565b820191905f5260205f20905b815481529060010190602001808311610fee57829003601f168201915b505050505081525050815250611b20565b1561102b5761102b8386611741565b5050505b600101610d8e565b506007546001600160a01b031661104f600a5f611c64565b8160ff1667ffffffffffffffff81111561106b5761106b611fd6565b604051908082528060200260200182016040528015611094578160200160208202803683370190505b5080516110a991600a91602090910190611c7f565b505f5b8260ff1681101561110e5781600a82815481106110cb576110cb611f74565b5f91825260208083209190910180546001600160a01b0319166001600160a01b0394851617905593821681526008909352604090922054909116906001016110ac565b5050505b50565b335f9081526003602052604090205460ff166111735760405162461bcd60e51b815260206004820152601960248201527f43616c6c6572206973206e6f7420612076616c696461746f72000000000000006044820152606401610263565b335f9081526002602081905260409091209081015460ff16156111d85760405162461bcd60e51b815260206004820152601d60248201527f56616c696461746f7220697320616c72656164792072657369676e65640000006044820152606401610263565b60028101805460ff19166001908117909155805481905f906111fb90839061228f565b90915550506040513381527f24250fc1ec78a1405ddd4cc8b75964858af228d05faa8d4bc1302966d8a541179060200160405180910390a150565b6005546060905f9067ffffffffffffffff81111561125657611256611fd6565b60405190808252806020026020018201604052801561128f57816020015b61127c611c1b565b8152602001906001900390816112745790505b5090505f5b600554811015610cbc575f600582815481106112b2576112b2611f74565b5f9182526020808320909101546001600160a01b03168083526002808352604093849020845180860186528381528551608081018752825481526001830154818701529282015460ff161515958301959095526003810180549396509094938401928591606084019161132490611f42565b80601f016020809104026020016040519081016040528092919081815260200182805461135090611f42565b801561139b5780601f106113725761010080835404028352916020019161139b565b820191905f5260205f20905b81548152906001019060200180831161137e57829003601f168201915b5050505050815250508152508484815181106113b9576113b9611f74565b60209081029190910101525050600101611294565b6001600160a01b038082165f90815260066020526040902080549091166113f3575050565b60018101546001600160a01b038316318110156114545761141e816001600160a01b03851631611f9c565b82546001600160a01b03165f908152600260205260408120600101805490919061144990849061228f565b909155506114999050565b6114686001600160a01b0384163182611f9c565b82546001600160a01b03165f9081526002602052604081206001018054909190611493908490611f9c565b90915550505b506001600160a01b0390911631600190910155565b6030811461150c5760405162461bcd60e51b815260206004820152602560248201527f424c5331322d333831207075626c69634b6579206c656e67746820697320696e6044820152641d985b1a5960da1b6064820152608401610263565b5050565b6005545f61151f600183611f9c565b90505b801561150c575f61153482600161228f565b60408051426020820152449181019190915260608101849052608001604051602081830303815290604052805190602001205f1c61157291906122a2565b90505f6005838154811061158857611588611f74565b5f91825260209091200154600580546001600160a01b03909216925090839081106115b5576115b5611f74565b5f91825260209091200154600580546001600160a01b0390921691859081106115e0576115e0611f74565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550806005838154811061161f5761161f611f74565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555050508080611657906122c1565b915050611522565b6007546001600160a01b03165b6001600160a01b038116156116a9576001600160a01b039081165f90815260086020526040902080546001600160a01b031981169091551661166c565b505f600955565b5f818311156117195760405162461bcd60e51b815260206004820152602f60248201527f4d696e696d756d2073686f756c64206265206c657373207468616e206f72206560448201526e7175616c20746f206d6178696d756d60881b6064820152608401610263565b8284101561172857508161173a565b8184111561173757508061173a565b50825b9392505050565b6001600160a01b0382165f9081526002602081815260408084208151608081018352815481526001820154938101939093529283015460ff1615159082015260038201805491929160608401919061179890611f42565b80601f01602080910402602001604051908101604052809291908181526020018280546117c490611f42565b801561180f5780601f106117e65761010080835404028352916020019161180f565b820191905f5260205f20905b8154815290600101906020018083116117f257829003601f168201915b5050509190925250506040805180820182526007546001600160a01b03168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff16151594820194909452600384018054969750611930969395509185019390929091606084019161188a90611f42565b80601f01602080910402602001604051908101604052809291908181526020018280546118b690611f42565b80156119015780601f106118d857610100808354040283529160200191611901565b820191905f5260205f20905b8154815290600101906020018083116118e457829003601f168201915b5050505050815250508152506040518060400160405280866001600160a01b0316815260200184815250611b20565b156119435761193e83611b6c565b611ac1565b6007546001600160a01b039081165f81815260086020526040902054909116905b6001600160a01b0382166119815761197c8186611bbd565b611abe565b6040805180820182526001600160a01b0384168082525f90815260026020818152918490208451608081018652815481526001820154818501529181015460ff16151594820194909452600384018054611a8e95938501939160608401916119e890611f42565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1490611f42565b8015611a5f5780601f10611a3657610100808354040283529160200191611a5f565b820191905f5260205f20905b815481529060010190602001808311611a4257829003601f168201915b5050505050815250508152506040518060400160405280886001600160a01b0316815260200186815250611b20565b15611a9d5761197c8186611bbd565b506001600160a01b038082165f908152600860205260409020541690611964565b50505b8160ff16600954111561041657600780546001600160a01b039081165f90815260086020526040812080546001600160a01b03198082169092558454931692168217909255600980549192611b15836122c1565b919050555050505050565b5f81602001516020015183602001516020015103611b505750805182516001600160a01b03918216911611611b66565b8160200151602001518360200151602001511190505b92915050565b600780546001600160a01b038381165f8181526008602052604081208054939094166001600160a01b0319938416179093558354909116179091556009805491611bb583611fbe565b919050555050565b6001600160a01b038281165f8181526008602052604080822080548686168085529284208054919096166001600160a01b031991821617909555928252825490931690921790556009805491611c1283611fbe565b91905055505050565b60405180604001604052805f6001600160a01b03168152602001611c5f60405180608001604052805f81526020015f81526020015f15158152602001606081525090565b905290565b5080545f8255905f5260205f20908101906111129190611ce2565b828054828255905f5260205f20908101928215611cd2579160200282015b82811115611cd257825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611c9d565b50611cde929150611ce2565b5090565b5b80821115611cde575f8155600101611ce3565b5f60208284031215611d06575f5ffd5b81356001600160a01b038116811461173a575f5ffd5b60018060a01b0381511682525f602082015160406020850152805160408501526020810151606085015260408101511515608085015260608101519050608060a085015280518060c08601525f5b81811015611d8757602081840181015160e0888401015201611d6a565b505f60e0828701015260e0601f19601f8301168601019250505092915050565b602081525f61173a6020830184611d1c565b5f5f60208385031215611dca575f5ffd5b823567ffffffffffffffff811115611de0575f5ffd5b8301601f81018513611df0575f5ffd5b803567ffffffffffffffff811115611e06575f5ffd5b8560208260051b8401011115611e1a575f5ffd5b6020919091019590945092505050565b5f5f60208385031215611e3b575f5ffd5b823567ffffffffffffffff811115611e51575f5ffd5b8301601f81018513611e61575f5ffd5b803567ffffffffffffffff811115611e77575f5ffd5b856020828401011115611e1a575f5ffd5b5f60208284031215611e98575f5ffd5b813567ffffffffffffffff811115611eae575f5ffd5b82016040818503121561173a575f5ffd5b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b82811015611f1657603f19878603018452611f01858351611d1c565b94506020938401939190910190600101611ee5565b50929695505050505050565b5f60208284031215611f32575f5ffd5b813560ff8116811461173a575f5ffd5b600181811c90821680611f5657607f821691505b602082108103610cbc57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115611b6657611b66611f88565b818382375f9101908152919050565b5f60018201611fcf57611fcf611f88565b5060010190565b634e487b7160e01b5f52604160045260245ffd5b601f82111561041657805f5260205f20601f840160051c8101602085101561200f5750805b601f840160051c820191505b8181101561202e575f815560010161201b565b5050505050565b815167ffffffffffffffff81111561204f5761204f611fd6565b6120638161205d8454611f42565b84611fea565b6020601f821160018114612095575f831561207e5750848201515b5f19600385901b1c1916600184901b17845561202e565b5f84815260208120601f198516915b828110156120c457878501518255602094850194600190920191016120a4565b50848210156120e157868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b03841681526040602082018190528101829052818360608301375f818301606090810191909152601f909201601f1916010192915050565b5f8235607e19833603018112612143575f5ffd5b9190910192915050565b67ffffffffffffffff83111561216557612165611fd6565b612179836121738354611f42565b83611fea565b5f601f8411600181146121aa575f85156121935750838201355b5f19600387901b1c1916600186901b17835561202e565b5f83815260208120601f198716915b828110156121d957868501358255602094850194600190920191016121b9565b50868210156121f5575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813581556020820135600182015560028101604083013580151580821461222c575f5ffd5b60ff19835416915060ff8116821783555050506060820135601e19833603018112612255575f5ffd5b8201803567ffffffffffffffff81111561226d575f5ffd5b602082019150803603821315612281575f5ffd5b61110e81836003860161214d565b80820180821115611b6657611b66611f88565b5f826122bc57634e487b7160e01b5f52601260045260245ffd5b500690565b5f816122cf576122cf611f88565b505f19019056fea2646970667358221220fb596a899783aa169bc4bac8389b7b024606b59ed939dfa3029105b691e2bc1964736f6c634300081b0033", + "sourceMap": "1326:9070:23:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6110:104;6186:24;;6110:104;;;160:25:31;;;148:2;133:18;6110:104:23;;;;;;;;6217:109;6291:24;:31;6217:109;;7811:229;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;9172:195::-;;;;;;:::i;:::-;;:::i;:::-;;8822:347;;;:::i;6329:840::-;;;;;;:::i;:::-;;:::i;8043:213::-;;;;;;:::i;:::-;;:::i;8259:560::-;;;;;;:::i;:::-;;:::i;5200:401::-;;;:::i;:::-;;;;;;;:::i;2837:1145::-;;;;;;:::i;:::-;;:::i;7172:361::-;;;:::i;7536:116::-;;;;;;:::i;:::-;-1:-1:-1;;;;;7619:29:23;7602:4;7619:29;;;:23;:29;;;;;;;;;7536:116;;;;4506:14:31;;4499:22;4481:41;;4469:2;4454:18;7536:116:23;4341:187:31;5999:108:23;6057:7;6077:26;5999:108;;5604:392;;;:::i;7811:229::-;7869:16;;:::i;:::-;-1:-1:-1;;;;;7619:29:23;;7602:4;7619:29;;;:23;:29;;;;;;;;7891:71;;;;-1:-1:-1;;;7891:71:23;;4735:2:31;7891:71:23;;;4717:21:31;4774:2;4754:18;;;4747:30;4813;4793:18;;;4786:58;4861:18;;7891:71:23;;;;;;;;;7973:63;;;;;;;;-1:-1:-1;;;;;7973:63:23;;;;;-1:-1:-1;8003:31:23;;;:24;7973:63;8003:31;;;;;;;7973:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8003:31;7973:63;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;7973:63:23;;;;-1:-1:-1;;;7973:63:23;;7966:70;7811:229;-1:-1:-1;;7811:229:23:o;9172:195::-;1985:10;-1:-1:-1;;;;;1999:6:23;1985:20;;1977:65;;;;-1:-1:-1;;;1977:65:23;;5477:2:31;1977:65:23;;;5459:21:31;;;5496:18;;;5489:30;5555:34;5535:18;;;5528:62;5607:18;;1977:65:23;5275:356:31;1977:65:23;9295:6:::1;9290:74;9307:17:::0;;::::1;9290:74;;;9336:23;9349:6;;9356:1;9349:9;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;9336:12;:23::i;:::-;9326:3;;9290:74;;;;9172:195:::0;;:::o;8822:347::-;8881:10;8853:18;8874;;;:6;:18;;;;;8904:15;;-1:-1:-1;;;;;8904:15:23;8896:57;;;;-1:-1:-1;;;8896:57:23;;5970:2:31;8896:57:23;;;5952:21:31;6009:2;5989:18;;;5982:30;-1:-1:-1;;;6028:18:31;;;6021:45;6083:18;;8896:57:23;5768:339:31;8896:57:23;8983:15;;8963:36;;;8971:10;6286:51:31;;-1:-1:-1;;;;;8983:15:23;;;6368:2:31;6353:18;;6346:60;8963:36:23;;6259:18:31;8963:36:23;;;;;;;9061:13;;;;;9029:15;;-1:-1:-1;;;;;9029:15:23;9004:41;;;;:24;:41;;;;;:53;;;:70;;9061:13;;9004:53;;:70;;9061:13;;9004:70;:::i;:::-;;;;-1:-1:-1;;9103:15:23;;-1:-1:-1;;;;;9103:15:23;9078:41;;;;:24;:41;;;;;:58;;9135:1;;9078:41;:58;;9135:1;;9078:58;:::i;:::-;;;;-1:-1:-1;;9154:10:23;9147:18;;;;:6;:18;;;;;9140:25;;-1:-1:-1;;;;;;9140:25:23;;;;;;-1:-1:-1;8822:347:23:o;6329:840::-;-1:-1:-1;;;;;2104:6:23;2090:20;:10;:20;2082:61;;;;-1:-1:-1;;;2082:61:23;;6884:2:31;2082:61:23;;;6866:21:31;6923:2;6903:18;;;6896:30;6962;6942:18;;;6935:58;7010:18;;2082:61:23;6682:352:31;2082:61:23;6452:10:::1;6428:35;::::0;;;:23:::1;:35;::::0;;;;;::::1;;6427:36;6419:80;;;::::0;-1:-1:-1;;;6419:80:23;;7241:2:31;6419:80:23::1;::::0;::::1;7223:21:31::0;7280:2;7260:18;;;7253:30;7319:33;7299:18;;;7292:61;7370:18;;6419:80:23::1;7039:355:31::0;6419:80:23::1;6504:27;6544:20;;6534:31;;;;;;;:::i;:::-;;::::0;;;;;::::1;::::0;;;6579:42:::1;::::0;;;:21:::1;:42;::::0;;;;;;6534:31;;-1:-1:-1;6579:42:23::1;;6578:43;6570:91;;;::::0;-1:-1:-1;;;6570:91:23;;7877:2:31;6570:91:23::1;::::0;::::1;7859:21:31::0;7916:2;7896:18;;;7889:30;7955:34;7935:18;;;7928:62;-1:-1:-1;;;8006:18:31;;;7999:33;8049:19;;6570:91:23::1;7675:399:31::0;6570:91:23::1;6666:46;6691:20;;6666:24;:46::i;:::-;6717:30;6750:126;;;;;;;;6782:1;6750:126;;;;6801:1;6750:126;;;;6819:5;6750:126;;;;;;6851:20;;6750:126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;-1:-1:-1;6750:126:23;;;;-1:-1:-1;;6881:28:23;;6717:159;;-1:-1:-1;6750:126:23;-1:-1:-1;6750:126:23;6881:28:::1;::::0;::::1;:::i;:::-;::::0;;;-1:-1:-1;;6937:10:23::1;6913:35;::::0;;;:23:::1;:35;::::0;;;;;;;:42;;6951:4:::1;-1:-1:-1::0;;6913:42:23;;::::1;::::0;::::1;::::0;;;6959:24:::1;:36:::0;;;;;;;:48;;;;;;::::1;::::0;;;::::1;::::0;;;;;;::::1;::::0;;;::::1;::::0;;;;::::1;::::0;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;::::1;::::0;;;:36;:48;::::1;::::0;::::1;::::0;;::::1;:::i;:::-;-1:-1:-1::0;;;7011:42:23::1;::::0;;;:21:::1;:42;::::0;;;;;:49;;-1:-1:-1;;7011:49:23::1;7056:4;7011:49:::0;;::::1;::::0;;;7064:21:::1;:38:::0;;;;::::1;::::0;;;;;;;;::::1;::::0;;-1:-1:-1;;;;;;7064:38:23::1;7091:10;7064:38:::0;;::::1;::::0;;;7112:53;;::::1;::::0;::::1;::::0;7144:20;;;;7112:53:::1;:::i;:::-;;;;;;;;6415:754;;6329:840:::0;;:::o;8043:213::-;8118:38;8140:15;;;;:10;:15;:::i;8118:38::-;8110:79;;;;-1:-1:-1;;;8110:79:23;;4735:2:31;8110:79:23;;;4717:21:31;4774:2;4754:18;;;4747:30;4813;4793:18;;;4786:58;4861:18;;8110:79:23;4533:352:31;8110:79:23;8237:15;;;;:10;:15;:::i;:::-;8193:24;:41;8218:15;;;;:10;:15;:::i;:::-;-1:-1:-1;;;;;8193:41:23;;;;;;;;;;;;-1:-1:-1;8193:41:23;:59;;:41;:59;:::i;8259:560::-;-1:-1:-1;;;;;2104:6:23;2090:20;:10;:20;2082:61;;;;-1:-1:-1;;;2082:61:23;;6884:2:31;2082:61:23;;;6866:21:31;6923:2;6903:18;;;6896:30;6962;6942:18;;;6935:58;7010:18;;2082:61:23;6682:352:31;2082:61:23;-1:-1:-1;;;;;7619:29:23;;7602:4;7619:29;;;:23;:29;;;;;;;;8313:63:::1;;;::::0;-1:-1:-1;;;8313:63:23;;13879:2:31;8313:63:23::1;::::0;::::1;13861:21:31::0;13918:2;13898:18;;;13891:30;13957:25;13937:18;;;13930:53;14000:18;;8313:63:23::1;13677:347:31::0;8313:63:23::1;8395:10;8428:1;8388:18:::0;;;:6:::1;:18;::::0;;;;:28;-1:-1:-1;;;;;8388:28:23::1;:42:::0;8380:68:::1;;;::::0;-1:-1:-1;;;8380:68:23;;14231:2:31;8380:68:23::1;::::0;::::1;14213:21:31::0;14270:2;14250:18;;;14243:30;-1:-1:-1;;;14289:18:31;;;14282:43;14342:18;;8380:68:23::1;14029:337:31::0;8380:68:23::1;-1:-1:-1::0;;;;;8491:30:23;::::1;8453:35;8491:30:::0;;;:24:::1;:30;::::0;;;;;;;8534:24;;::::1;::::0;::::1;;8533:25;8525:72;;;::::0;-1:-1:-1;;;8525:72:23;;14573:2:31;8525:72:23::1;::::0;::::1;14555:21:31::0;14612:2;14592:18;;;14585:30;14651:34;14631:18;;;14624:62;-1:-1:-1;;;14702:18:31;;;14695:32;14744:19;;8525:72:23::1;14371:398:31::0;8525:72:23::1;8623:52;::::0;;;;::::1;::::0;;-1:-1:-1;;;;;8623:52:23;;::::1;::::0;;8655:10:::1;:18:::0;::::1;8623:52;::::0;;::::1;::::0;;;-1:-1:-1;8602:18:23;;;:6:::1;:18:::0;;;;;;:73;;;;-1:-1:-1;;;;;;8602:73:23::1;::::0;::::1;::::0;;;::::1;::::0;;;;-1:-1:-1;8602:73:23;;::::1;::::0;8701:25;;::::1;:47:::0;;8730:18;::::1;::::0;8701:25;;:47:::1;::::0;8730:18;;8701:47:::1;:::i;:::-;::::0;;;-1:-1:-1;;8752:30:23;;8781:1:::1;::::0;8752:13;;:25:::1;::::0;:30:::1;::::0;8781:1;;8752:30:::1;:::i;:::-;::::0;;;-1:-1:-1;;8792:23:23::1;::::0;;8798:10:::1;6286:51:31::0;;-1:-1:-1;;;;;6373:32:31;;6368:2;6353:18;;6346:60;8792:23:23::1;::::0;6259:18:31;8792:23:23::1;;;;;;;8309:510;8259:560:::0;:::o;5200:401::-;5317:24;:31;5249:18;;5273:25;;5301:48;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;5273:76:23;-1:-1:-1;5358:6:23;5353:227;5374:24;:31;5370:35;;5353:227;;;5417:12;5432:24;5457:1;5432:27;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;5432:27:23;5493:30;;;:24;:30;;;;;;;;5540:35;;;;;;;;;;;;;;;;;;;;;5432:27;5540:35;;;;;;;;;;;;;;;;;;;;;;;;;;;5432:27;;-1:-1:-1;5493:30:23;;5540:35;;;;5493:30;;5540:35;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5528:6;5535:1;5528:9;;;;;;;;:::i;:::-;;;;;;;;;;:47;-1:-1:-1;;5407:3:23;;5353:227;;;-1:-1:-1;5591:6:23;5200:401;-1:-1:-1;5200:401:23:o;2837:1145::-;1985:10;-1:-1:-1;;;;;1999:6:23;1985:20;;1977:65;;;;-1:-1:-1;;;1977:65:23;;5477:2:31;1977:65:23;;;5459:21:31;;;5496:18;;;5489:30;5555:34;5535:18;;;5528:62;5607:18;;1977:65:23;5275:356:31;1977:65:23;2901:9:::1;:7;:9::i;:::-;2914:21;:19;:21::i;:::-;2940:5;:18:::0;;-1:-1:-1;;;;;;2940:18:23::1;::::0;;;3023:24;2956:1:::1;2994:26:::0;;2956:1;;2981:67:::1;::::0;::::1;::::0;::::1;::::0;2956:1;;2994:53:::1;::::0;3023:24;2994:53:::1;:::i;:::-;2981:6;:67::i;:::-;2963:86;;3116:3;:8;;3123:1;3116:8:::0;3112:30:::1;;3131:7;2837:1145:::0;:::o;3112:30::-:1;3151:6;3146:614;3167:21;:28:::0;3163:32;::::1;3146:614;;;3207:12;3222:21;3244:1;3222:24;;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;;;::::1;::::0;-1:-1:-1;;;;;3222:24:23::1;3281:30:::0;;;:24:::1;:30:::0;;;;;;;;3320:15;;::::1;::::0;3222:24;;-1:-1:-1;3281:30:23;3320:15:::1;;3316:41;;;3343:8;;;;3316:41;3366:5;::::0;-1:-1:-1;;;;;3366:5:23::1;3362:92;;-1:-1:-1::0;3393:5:23::1;:12:::0;;-1:-1:-1;;;;;;3393:12:23::1;-1:-1:-1::0;;;;;3393:12:23;;;::::1;::::0;;;::::1;::::0;;-1:-1:-1;3411:19:23::1;:23:::0;3440:8:::1;;3362:92;3485:3;3463:25;;:19;;:25;3459:86;;;3496:29;3515:4;3521:3;3496:18;:29::i;:::-;3531:8;;;;3459:86;3608:5;::::0;-1:-1:-1;;;;;3608:5:23;;::::1;3550:30;3583:31:::0;;;:24:::1;:31;::::0;;;;;;;;3635:35;;;;::::1;::::0;;;;::::1;::::0;;;;::::1;::::0;::::1;::::0;;;;;;3608:5;3635:35;::::1;::::0;;;::::1;::::0;;;::::1;::::0;::::1;;;;::::0;;;;;;;::::1;::::0;::::1;::::0;;3583:31;;3624:89:::1;::::0;3635:35;;;;::::1;::::0;;3664:4;;3635:35;;;;;::::1;::::0;::::1;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;3635:35:23;;;;-1:-1:-1;;;3635:35:23;;3672:40:::1;::::0;;;;::::1;::::0;;3689:5:::1;::::0;-1:-1:-1;;;;;3689:5:23::1;3672:40:::0;;;;::::1;::::0;::::1;::::0;;;;;;3689:5;3672:40;::::1;::::0;::::1;::::0;;::::1;::::0;;;;::::1;::::0;::::1;::::0;::::1;;;;::::0;;;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;3702:8;;3672:40;;;;::::1;::::0;::::1;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;::::0;3624:10:::1;:89::i;:::-;3620:136;;;3721:29;3740:4;3746:3;3721:18;:29::i;:::-;3202:558;;;3146:614;3197:3;;3146:614;;;-1:-1:-1::0;3779:5:23::1;::::0;-1:-1:-1;;;;;3779:5:23::1;3788:31;3795:24;3764:12;3788:31;:::i;:::-;3864:3;3850:18;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;-1:-1:-1;3850:18:23::1;-1:-1:-1::0;3823:45:23;;::::1;::::0;:24:::1;::::0;:45:::1;::::0;;::::1;::::0;::::1;:::i;:::-;-1:-1:-1::0;3877:6:23::1;3872:107;3893:3;3889:7;;:1;:7;3872:107;;;3938:4;3908:24;3933:1;3908:27;;;;;;;;:::i;:::-;;::::0;;;::::1;::::0;;;;;;::::1;:34:::0;;-1:-1:-1;;;;;;3908:34:23::1;-1:-1:-1::0;;;;;3908:34:23;;::::1;;::::0;;3954:20;;::::1;::::0;;:14:::1;:20:::0;;;;;;;;;;::::1;::::0;-1:-1:-1;3898:3:23::1;3872:107;;;;2897:1085;;2046:1;2837:1145:::0;:::o;7172:361::-;7242:10;7602:4;7619:29;;;:23;:29;;;;;;;;7212:71;;;;-1:-1:-1;;;7212:71:23;;15106:2:31;7212:71:23;;;15088:21:31;15145:2;15125:18;;;15118:30;15184:27;15164:18;;;15157:55;15229:18;;7212:71:23;14904:349:31;7212:71:23;7347:10;7288:31;7322:36;;;:24;:36;;;;;;;;7371:20;;;;;;7370:21;7362:63;;;;-1:-1:-1;;;7362:63:23;;15460:2:31;7362:63:23;;;15442:21:31;15499:2;15479:18;;;15472:30;15538:31;15518:18;;;15511:59;15587:18;;7362:63:23;15258:353:31;7362:63:23;7430:20;;;:27;;-1:-1:-1;;7430:27:23;7453:4;7430:27;;;;;;7461:29;;7453:4;;7430:20;;7461:29;;7453:4;;7461:29;:::i;:::-;;;;-1:-1:-1;;7500:29:23;;7518:10;15762:51:31;;7500:29:23;;15750:2:31;15735:18;7500:29:23;;;;;;;7208:325;7172:361::o;5604:392::-;5721:21;:28;5653:18;;5677:25;;5705:45;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;5677:73:23;-1:-1:-1;5759:6:23;5754:221;5775:21;:28;5771:32;;5754:221;;;5815:12;5830:21;5852:1;5830:24;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;5830:24:23;5888:30;;;:24;:30;;;;;;;;5935:35;;;;;;;;;;;;;;;;;;;;;5830:24;5935:35;;;;;;;;;;;;;;;;;;;;;;;;;;;5830:24;;-1:-1:-1;5888:30:23;;5935:35;;;;5888:30;;5935:35;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5923:6;5930:1;5923:9;;;;;;;;:::i;:::-;;;;;;;;;;:47;-1:-1:-1;;5805:3:23;;5754:221;;9370:444;-1:-1:-1;;;;;9439:12:23;;;9418:18;9439:12;;;:6;:12;;;;;9459:15;;9439:12;;9459:15;9455:51;;9495:7;9370:444;:::o;9455:51::-;9533:13;;;;-1:-1:-1;;;;;9570:12:23;;;9555:27;;9551:227;;;9646:27;9661:12;-1:-1:-1;;;;;9646:12:23;;;:27;:::i;:::-;9614:15;;-1:-1:-1;;;;;9614:15:23;9589:41;;;;:24;:41;;;;;9614:15;9589:53;:84;;:53;;:41;:84;;;;;:::i;:::-;;;;-1:-1:-1;9551:227:23;;-1:-1:-1;9551:227:23;;9746:27;-1:-1:-1;;;;;9761:12:23;;;9746;:27;:::i;:::-;9714:15;;-1:-1:-1;;;;;9714:15:23;9689:41;;;;:24;:41;;;;;9714:15;9689:53;:84;;:53;;:41;:84;;;;;:::i;:::-;;;;-1:-1:-1;;9551:227:23;-1:-1:-1;;;;;;9798:12:23;;;;9782:13;;;;:28;9370:444::o;7655:153::-;7760:2;7740:22;;7732:72;;;;-1:-1:-1;;;7732:72:23;;16026:2:31;7732:72:23;;;16008:21:31;16065:2;16045:18;;;16038:30;16104:34;16084:18;;;16077:62;-1:-1:-1;;;16155:18:31;;;16148:35;16200:19;;7732:72:23;15824:401:31;7732:72:23;7655:153;;:::o;2155:448::-;2199:21;:28;2187:9;2248:5;2252:1;2199:28;2248:5;:::i;:::-;2236:17;;2231:369;2255:5;;2231:369;;2325:9;2415:5;:1;2419;2415:5;:::i;:::-;2355:54;;;2372:15;2355:54;;;16415:19:31;2389:16:23;16450:12:31;;;16443:28;;;;16487:12;;;16480:28;;;16524:12;;2355:54:23;;;;;;;;;;;;2345:65;;;;;;2337:74;;:84;;;;:::i;:::-;2325:96;;2464:12;2479:21;2501:1;2479:24;;;;;;;;:::i;:::-;;;;;;;;;;;2535:21;:24;;-1:-1:-1;;;;;2479:24:23;;;;-1:-1:-1;2535:21:23;2557:1;;2535:24;;;;;;:::i;:::-;;;;;;;;;;;2508:21;:24;;-1:-1:-1;;;;;2535:24:23;;;;2530:1;;2508:24;;;;;;:::i;:::-;;;;;;;;;:51;;;;;-1:-1:-1;;;;;2508:51:23;;;;;-1:-1:-1;;;;;2508:51:23;;;;;;2591:4;2564:21;2586:1;2564:24;;;;;;;;:::i;:::-;;;;;;;;;:31;;;;;-1:-1:-1;;;;;2564:31:23;;;;;-1:-1:-1;;;;;2564:31:23;;;;;;2267:333;;2262:3;;;;;:::i;:::-;;;;2231:369;;2606:228;2665:5;;-1:-1:-1;;;;;2665:5:23;2675:129;-1:-1:-1;;;;;2682:18:23;;;2675:129;;-1:-1:-1;;;;;2741:23:23;;;2707:15;2741:23;;;:14;:23;;;;;;;-1:-1:-1;;;;;;2769:30:23;;;;;2741:23;2675:129;;;-1:-1:-1;2829:1:23;2807:19;:23;2606:228::o;10117:277::-;10196:7;10224:3;10217;:10;;10209:70;;;;-1:-1:-1;;;10209:70:23;;17104:2:31;10209:70:23;;;17086:21:31;17143:2;17123:18;;;17116:30;17182:34;17162:18;;;17155:62;-1:-1:-1;;;17233:18:31;;;17226:45;17288:19;;10209:70:23;16902:411:31;10209:70:23;10295:3;10287:5;:11;10283:108;;;-1:-1:-1;10312:3:23;10305:10;;10283:108;10338:3;10330:5;:11;10326:65;;;-1:-1:-1;10355:3:23;10348:10;;10326:65;-1:-1:-1;10381:5:23;10326:65;10117:277;;;;;:::o;3985:921::-;-1:-1:-1;;;;;4079:30:23;;4051:25;4079:30;;;:24;:30;;;;;;;;4051:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4079:30;4051:58;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;4051:58:23;;;;-1:-1:-1;;4138:63:23;;;;;;;;4155:5;;-1:-1:-1;;;;;4155:5:23;4138:63;;;-1:-1:-1;4168:31:23;;;:24;4138:63;4168:31;;;;;;;4138:63;;;;;;;;;;;4155:5;4138:63;;;;;;;;;;;;;;;;;;;;;;;;;;;4051:58;;-1:-1:-1;4122:125:23;;4138:63;;-1:-1:-1;4138:63:23;;;;;;4168:31;;4138:63;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4207:35;;;;;;;;4224:4;-1:-1:-1;;;;;4207:35:23;;;;;4236:4;4207:35;;;4122:10;:125::i;:::-;4114:632;;;4257:16;4268:4;4257:10;:16::i;:::-;4114:632;;;4322:5;;-1:-1:-1;;;;;4322:5:23;;;4289:15;4307:21;;;:14;:21;;;;;;;;;;4363:379;-1:-1:-1;;;;;4386:21:23;;4382:80;;4416:27;4428:8;4438:4;4416:11;:27::i;:::-;4450:5;;4382:80;4496:67;;;;;;;;-1:-1:-1;;;;;4496:67:23;;;;;-1:-1:-1;4528:33:23;;;:24;4496:67;4528:33;;;;;;;4496:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4478:135;;4496:67;;;;4528:33;4496:67;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4571:35;;;;;;;;4588:4;-1:-1:-1;;;;;4571:35:23;;;;;4600:4;4571:35;;;4478:10;:135::i;:::-;4468:205;;;4627:27;4639:8;4649:4;4627:11;:27::i;4468:205::-;-1:-1:-1;;;;;;4713:23:23;;;;;;;:14;:23;;;;;;;;4363:379;;;4284:462;;4114:632;4776:3;4754:25;;:19;;:25;4750:153;;;4816:5;;;-1:-1:-1;;;;;4816:5:23;;;4786:12;4801:21;;;:14;:21;;;;;;;-1:-1:-1;;;;;;4827:28:23;;;;;;4860:12;;4801:21;;4860:12;;;;;;;4877:19;:21;;4801;;4877;;;:::i;:::-;;;;;;4781:122;4047:859;3985:921;;:::o;9817:297::-;9918:4;9963:10;:15;;;:27;;;9932:10;:15;;;:27;;;:58;9928:114;;-1:-1:-1;10022:15:23;;10004;;-1:-1:-1;;;;;10004:33:23;;;;;;9997:40;;9928:114;10083:10;:15;;;:27;;;10053:10;:15;;;:27;;;:57;10046:64;;9817:297;;;;;:::o;4909:120::-;4979:5;;;-1:-1:-1;;;;;4956:20:23;;;4979:5;4956:20;;;:14;:20;;;;;:28;;4979:5;;;;-1:-1:-1;;;;;;4956:28:23;;;;;;;4988:12;;;;;;;;;5004:19;:21;;;;;;:::i;:::-;;;;;;4909:120;:::o;5032:165::-;-1:-1:-1;;;;;5117:20:23;;;;;;;:14;:20;;;;;;;;5094;;;;;;;;;:43;;5117:20;;;;-1:-1:-1;;;;;;5094:43:23;;;;;;;5141:20;;;:27;;;;;;;;;;5172:19;:21;;;;;;:::i;:::-;;;;;;5032:165;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;196:286:31;255:6;308:2;296:9;287:7;283:23;279:32;276:52;;;324:1;321;314:12;276:52;350:23;;-1:-1:-1;;;;;402:31:31;;392:42;;382:70;;448:1;445;438:12;487:871;604:1;600;595:3;591:11;587:19;579:5;573:12;569:38;564:3;557:51;539:3;654:4;647:5;643:16;637:23;692:4;685;680:3;676:14;669:28;735:12;729:19;722:4;717:3;713:14;706:43;803:4;789:12;785:23;779:30;774:2;769:3;765:12;758:52;880:4;866:12;862:23;856:30;849:38;842:46;835:4;830:3;826:14;819:70;944:2;930:12;926:21;920:28;898:50;;979:4;973:3;968;964:13;957:27;1013:14;1007:21;1059:6;1053:3;1048;1044:13;1037:29;1084:1;1094:147;1108:6;1105:1;1102:13;1094:147;;;1224:4;1200:22;;;1196:33;;1190:40;1184:3;1171:11;;;1167:21;1160:71;1123:12;1094:147;;;1098:3;1285:1;1279:3;1270:6;1265:3;1261:16;1257:26;1250:37;1348:3;1341:2;1337:7;1332:2;1324:6;1320:15;1316:29;1311:3;1307:39;1303:49;1296:56;;;;487:871;;;;:::o;1363:266::-;1548:2;1537:9;1530:21;1511:4;1568:55;1619:2;1608:9;1604:18;1596:6;1568:55;:::i;1634:610::-;1720:6;1728;1781:2;1769:9;1760:7;1756:23;1752:32;1749:52;;;1797:1;1794;1787:12;1749:52;1837:9;1824:23;1870:18;1862:6;1859:30;1856:50;;;1902:1;1899;1892:12;1856:50;1925:22;;1978:4;1970:13;;1966:27;-1:-1:-1;1956:55:31;;2007:1;2004;1997:12;1956:55;2047:2;2034:16;2073:18;2065:6;2062:30;2059:50;;;2105:1;2102;2095:12;2059:50;2158:7;2153:2;2143:6;2140:1;2136:14;2132:2;2128:23;2124:32;2121:45;2118:65;;;2179:1;2176;2169:12;2118:65;2210:2;2202:11;;;;;2232:6;;-1:-1:-1;1634:610:31;-1:-1:-1;;;1634:610:31:o;2249:586::-;2319:6;2327;2380:2;2368:9;2359:7;2355:23;2351:32;2348:52;;;2396:1;2393;2386:12;2348:52;2436:9;2423:23;2469:18;2461:6;2458:30;2455:50;;;2501:1;2498;2491:12;2455:50;2524:22;;2577:4;2569:13;;2565:27;-1:-1:-1;2555:55:31;;2606:1;2603;2596:12;2555:55;2646:2;2633:16;2672:18;2664:6;2661:30;2658:50;;;2704:1;2701;2694:12;2658:50;2749:7;2744:2;2735:6;2731:2;2727:15;2723:24;2720:37;2717:57;;;2770:1;2767;2760:12;2840:389;2929:6;2982:2;2970:9;2961:7;2957:23;2953:32;2950:52;;;2998:1;2995;2988:12;2950:52;3038:9;3025:23;3071:18;3063:6;3060:30;3057:50;;;3103:1;3100;3093:12;3057:50;3126:22;;3182:2;3164:16;;;3160:25;3157:45;;;3198:1;3195;3188:12;3234:828;3432:4;3480:2;3469:9;3465:18;3510:2;3499:9;3492:21;3533:6;3568;3562:13;3599:6;3591;3584:22;3637:2;3626:9;3622:18;3615:25;;3699:2;3689:6;3686:1;3682:14;3671:9;3667:30;3663:39;3649:53;;3737:2;3729:6;3725:15;3758:1;3768:265;3782:6;3779:1;3776:13;3768:265;;;3875:2;3871:7;3859:9;3851:6;3847:22;3843:36;3838:3;3831:49;3903:50;3946:6;3937;3931:13;3903:50;:::i;:::-;3893:60;-1:-1:-1;3988:2:31;4011:12;;;;3976:15;;;;;3804:1;3797:9;3768:265;;;-1:-1:-1;4050:6:31;;3234:828;-1:-1:-1;;;;;;3234:828:31:o;4067:269::-;4124:6;4177:2;4165:9;4156:7;4152:23;4148:32;4145:52;;;4193:1;4190;4183:12;4145:52;4232:9;4219:23;4282:4;4275:5;4271:16;4264:5;4261:27;4251:55;;4302:1;4299;4292:12;4890:380;4969:1;4965:12;;;;5012;;;5033:61;;5087:4;5079:6;5075:17;5065:27;;5033:61;5140:2;5132:6;5129:14;5109:18;5106:38;5103:161;;5186:10;5181:3;5177:20;5174:1;5167:31;5221:4;5218:1;5211:15;5249:4;5246:1;5239:15;5636:127;5697:10;5692:3;5688:20;5685:1;5678:31;5728:4;5725:1;5718:15;5752:4;5749:1;5742:15;6417:127;6478:10;6473:3;6469:20;6466:1;6459:31;6509:4;6506:1;6499:15;6533:4;6530:1;6523:15;6549:128;6616:9;;;6637:11;;;6634:37;;;6651:18;;:::i;7399:271::-;7582:6;7574;7569:3;7556:33;7538:3;7608:16;;7633:13;;;7608:16;7399:271;-1:-1:-1;7399:271:31:o;8079:135::-;8118:3;8139:17;;;8136:43;;8159:18;;:::i;:::-;-1:-1:-1;8206:1:31;8195:13;;8079:135::o;8219:127::-;8280:10;8275:3;8271:20;8268:1;8261:31;8311:4;8308:1;8301:15;8335:4;8332:1;8325:15;8476:517;8577:2;8572:3;8569:11;8566:421;;;8613:5;8610:1;8603:16;8657:4;8654:1;8644:18;8727:2;8715:10;8711:19;8708:1;8704:27;8698:4;8694:38;8763:4;8751:10;8748:20;8745:47;;;-1:-1:-1;8786:4:31;8745:47;8841:2;8836:3;8832:12;8829:1;8825:20;8819:4;8815:31;8805:41;;8896:81;8914:2;8907:5;8904:13;8896:81;;;8973:1;8959:16;;8940:1;8929:13;8896:81;;;8900:3;;8476:517;;;:::o;9169:1295::-;9293:3;9287:10;9320:18;9312:6;9309:30;9306:56;;;9342:18;;:::i;:::-;9371:96;9460:6;9420:38;9452:4;9446:11;9420:38;:::i;:::-;9414:4;9371:96;:::i;:::-;9516:4;9547:2;9536:14;;9564:1;9559:648;;;;10251:1;10268:6;10265:89;;;-1:-1:-1;10320:19:31;;;10314:26;10265:89;-1:-1:-1;;9126:1:31;9122:11;;;9118:24;9114:29;9104:40;9150:1;9146:11;;;9101:57;10367:81;;9529:929;;9559:648;8423:1;8416:14;;;8460:4;8447:18;;-1:-1:-1;;9595:20:31;;;9712:222;9726:7;9723:1;9720:14;9712:222;;;9808:19;;;9802:26;9787:42;;9915:4;9900:20;;;;9868:1;9856:14;;;;9742:12;9712:222;;;9716:3;9962:6;9953:7;9950:19;9947:201;;;10023:19;;;10017:26;-1:-1:-1;;10106:1:31;10102:14;;;10118:3;10098:24;10094:37;10090:42;10075:58;10060:74;;9947:201;-1:-1:-1;;;;10194:1:31;10178:14;;;10174:22;10161:36;;-1:-1:-1;9169:1295:31:o;10469:485::-;-1:-1:-1;;;;;10654:32:31;;10636:51;;10723:2;10718;10703:18;;10696:30;;;10742:18;;10735:34;;;10762:6;10811;10806:2;10791:18;;10778:48;10875:1;10846:22;;;10870:2;10842:31;;;10835:42;;;;10938:2;10917:15;;;-1:-1:-1;;10913:29:31;10898:45;10894:54;;10469:485;-1:-1:-1;;10469:485:31:o;10959:332::-;11059:4;11117:11;11104:25;11211:3;11207:8;11196;11180:14;11176:29;11172:44;11152:18;11148:69;11138:97;;11231:1;11228;11221:12;11138:97;11252:33;;;;;10959:332;-1:-1:-1;;10959:332:31:o;11296:1178::-;11402:18;11397:3;11394:27;11391:53;;;11424:18;;:::i;:::-;11453:93;11542:3;11502:38;11534:4;11528:11;11502:38;:::i;:::-;11496:4;11453:93;:::i;:::-;11572:1;11597:2;11592:3;11589:11;11614:1;11609:607;;;;12260:1;12277:3;12274:93;;;-1:-1:-1;12333:19:31;;;12320:33;12274:93;-1:-1:-1;;9126:1:31;9122:11;;;9118:24;9114:29;9104:40;9150:1;9146:11;;;9101:57;12380:78;;11582:886;;11609:607;8423:1;8416:14;;;8460:4;8447:18;;-1:-1:-1;;11645:17:31;;;11759:229;11773:7;11770:1;11767:14;11759:229;;;11862:19;;;11849:33;11834:49;;11969:4;11954:20;;;;11922:1;11910:14;;;;11789:12;11759:229;;;11763:3;12016;12007:7;12004:16;12001:159;;;12140:1;12136:6;12130:3;12124;12121:1;12117:11;12113:21;12109:34;12105:39;12092:9;12087:3;12083:19;12070:33;12066:79;12058:6;12051:95;12001:159;;;12203:1;12197:3;12194:1;12190:11;12186:19;12180:4;12173:33;11582:886;;11296:1178;;;:::o;12479:1193::-;12674:19;;12702:25;;12808:2;12797:14;;12784:28;12838:1;12828:12;;12821:35;12893:1;12883:12;;12943:2;12932:14;;12919:28;12973:15;;12966:23;13008:15;;;12998:43;;13037:1;13034;13027:12;12998:43;13092:3;13088:8;13075:10;13069:17;13065:32;13050:47;;13145:3;13141:2;13137:12;13128:7;13125:25;13113:10;13106:45;;;;13210:2;13203:5;13199:14;13186:28;13293:2;13289:7;13281:5;13265:14;13261:26;13257:40;13237:18;13233:65;13223:93;;13312:1;13309;13302:12;13223:93;13337:30;;13390:18;;13431;13420:30;;13417:50;;;13463:1;13460;13453:12;13417:50;13500:2;13494:4;13490:13;13476:27;;13547:6;13531:14;13527:27;13519:6;13515:40;13512:60;;;13568:1;13565;13558:12;13512:60;13581:85;13659:6;13651;13647:1;13641:4;13637:12;13581:85;:::i;14774:125::-;14839:9;;;14860:10;;;14857:36;;;14873:18;;:::i;16547:209::-;16579:1;16605;16595:132;;16649:10;16644:3;16640:20;16637:1;16630:31;16684:4;16681:1;16674:15;16712:4;16709:1;16702:15;16595:132;-1:-1:-1;16741:9:31;;16547:209::o;16761:136::-;16800:3;16828:5;16818:39;;16837:18;;:::i;:::-;-1:-1:-1;;;16873:18:31;;16761:136::o", + "linkReferences": {}, + "immutableReferences": { + "39820": [ + { "start": 872, "length": 32 }, + { "start": 1352, "length": 32 }, + { "start": 2238, "length": 32 }, + { "start": 3277, "length": 32 } + ] + } + }, + "methodIdentifiers": { + "activeValidatorsCount()": "0d2bd909", + "calculateTopValidators(uint8)": "b5cfa68c", + "getAllValidators()": "f3513a37", + "getTopValidators()": "afeea115", + "getValidator(address)": "1904bb2e", + "isValidatorRegistered(address)": "d04a68c7", + "registerValidator(bytes)": "602a9eee", + "registeredValidatorsCount()": "f1bd0b37", + "resignValidator()": "b85f5da2", + "resignedValidatorsCount()": "0777cbef", + "unvote()": "3174b689", + "updateValidator((address,(uint256,uint256,bool,bytes)))": "62525879", + "updateVoters(address[])": "2bdf6d43", + "vote(address)": "6dd7d8ea" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"Unvoted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"name\":\"ValidatorRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"ValidatorResigned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"validator\",\"type\":\"address\"}],\"name\":\"Voted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"activeValidatorsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"n\",\"type\":\"uint8\"}],\"name\":\"calculateTopValidators\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllValidators\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"votersCount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"voteBalance\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isResigned\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"internalType\":\"struct ValidatorData\",\"name\":\"data\",\"type\":\"tuple\"}],\"internalType\":\"struct Validator[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTopValidators\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"votersCount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"voteBalance\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isResigned\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"internalType\":\"struct ValidatorData\",\"name\":\"data\",\"type\":\"tuple\"}],\"internalType\":\"struct Validator[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getValidator\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"votersCount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"voteBalance\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isResigned\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"internalType\":\"struct ValidatorData\",\"name\":\"data\",\"type\":\"tuple\"}],\"internalType\":\"struct Validator\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isValidatorRegistered\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"name\":\"registerValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registeredValidatorsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resignValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resignedValidatorsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unvote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"votersCount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"voteBalance\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isResigned\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bls12_381_public_key\",\"type\":\"bytes\"}],\"internalType\":\"struct ValidatorData\",\"name\":\"data\",\"type\":\"tuple\"}],\"internalType\":\"struct Validator\",\"name\":\"_validator\",\"type\":\"tuple\"}],\"name\":\"updateValidator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"voters\",\"type\":\"address[]\"}],\"name\":\"updateVoters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"vote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/consensus/Consensus.sol\":\"Consensus\"},\"evmVersion\":\"shanghai\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@contracts/=src/\",\":@forge-std/=forge-std/src/\"]},\"sources\":{\"src/consensus/Consensus.sol\":{\"keccak256\":\"0xa9de7b08abcc3d2e7e8f5adce9534f6ec28beb6b06e8b49bfc1b521ec53fad5d\",\"urls\":[\"bzz-raw://0ed11153c9aa281668334067cc7d224100767edb8f73d881ad6ca9cb0ef875dd\",\"dweb:/ipfs/QmfKZcviJjgYoUL1ToN5NWr7Xb3k9iYbgqP1W4Zn5qLuRU\"]}},\"version\":1}", + "metadata": { + "compiler": { "version": "0.8.27+commit.40a35a09" }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address", + "indexed": false + }, + { + "internalType": "address", + "name": "validator", + "type": "address", + "indexed": false + } + ], + "type": "event", + "name": "Unvoted", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address", + "indexed": false + }, + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes", + "indexed": false + } + ], + "type": "event", + "name": "ValidatorRegistered", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address", + "indexed": false + } + ], + "type": "event", + "name": "ValidatorResigned", + "anonymous": false + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address", + "indexed": false + }, + { + "internalType": "address", + "name": "validator", + "type": "address", + "indexed": false + } + ], + "type": "event", + "name": "Voted", + "anonymous": false + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "activeValidatorsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "n", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "calculateTopValidators" + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "getAllValidators", + "outputs": [ + { + "internalType": "struct Validator[]", + "name": "", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "struct ValidatorData", + "name": "data", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "votersCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isResigned", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes" + } + ] + } + ] + } + ] + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "getTopValidators", + "outputs": [ + { + "internalType": "struct Validator[]", + "name": "", + "type": "tuple[]", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "struct ValidatorData", + "name": "data", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "votersCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isResigned", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes" + } + ] + } + ] + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "getValidator", + "outputs": [ + { + "internalType": "struct Validator", + "name": "", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "struct ValidatorData", + "name": "data", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "votersCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isResigned", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes" + } + ] + } + ] + } + ] + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function", + "name": "isValidatorRegistered", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" } + ] + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "registerValidator" + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "registeredValidatorsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "function", + "name": "resignValidator" + }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "resignedValidatorsCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "function", + "name": "unvote" + }, + { + "inputs": [ + { + "internalType": "struct Validator", + "name": "_validator", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "struct ValidatorData", + "name": "data", + "type": "tuple", + "components": [ + { + "internalType": "uint256", + "name": "votersCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "voteBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isResigned", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "bls12_381_public_key", + "type": "bytes" + } + ] + } + ] + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "updateValidator" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "voters", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "updateVoters" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "vote" + } + ], + "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, + "userdoc": { "kind": "user", "methods": {}, "version": 1 } + }, + "settings": { + "remappings": ["@contracts/=src/", "@forge-std/=forge-std/src/"], + "optimizer": { "enabled": true, "runs": 200 }, + "metadata": { "bytecodeHash": "ipfs" }, + "compilationTarget": { "src/consensus/Consensus.sol": "Consensus" }, + "evmVersion": "shanghai", + "libraries": {} + }, + "sources": { + "src/consensus/Consensus.sol": { + "keccak256": "0xa9de7b08abcc3d2e7e8f5adce9534f6ec28beb6b06e8b49bfc1b521ec53fad5d", + "urls": [ + "bzz-raw://0ed11153c9aa281668334067cc7d224100767edb8f73d881ad6ca9cb0ef875dd", + "dweb:/ipfs/QmfKZcviJjgYoUL1ToN5NWr7Xb3k9iYbgqP1W4Zn5qLuRU" + ], + "license": null + } + }, + "version": 1 + }, + "id": 23 +} diff --git a/src/Utils/AbiBase.php b/src/Utils/AbiBase.php new file mode 100644 index 00000000..ac6af096 --- /dev/null +++ b/src/Utils/AbiBase.php @@ -0,0 +1,76 @@ +abi = json_decode($abiJson, true)['abi']; + } + + protected function getArrayComponents(string $type): ?array + { + if (preg_match('/^(.*)\[(\d*)\]$/', $type, $matches)) { + $innerType = $matches[1]; + $lengthStr = $matches[2]; + $length = $lengthStr !== '' ? intval($lengthStr) : null; + + return [$length, $innerType]; + } + + return null; + } + + protected function stripHexPrefix(string $hex): string + { + if (substr($hex, 0, 2) === '0x') { + return substr($hex, 2); + } + + return $hex; + } + + protected function isValidAddress($address): bool + { + return is_string($address) + && str_starts_with($address, '0x') + && strlen($address) === 42 + && ctype_xdigit(substr($address, 2)); + } + + protected function keccak256(string $input): string + { + return '0x'.Keccak::hash($input, 256); + } + + protected function getFunctionSignature(array $abiItem): string + { + $name = $abiItem['name']; + $inputs = $abiItem['inputs']; + $types = array_map(function ($input) { + return $input['type']; + }, $inputs); + + return $name.'('.implode(',', $types).')'; + } + + protected function toFunctionSelector(array $abiItem): string + { + $signature = $this->getFunctionSignature($abiItem); + $hash = $this->keccak256($signature); + $selector = '0x'.substr($hash, 2, 8); + + return $selector; + } +} diff --git a/src/Utils/AbiDecoder.php b/src/Utils/AbiDecoder.php new file mode 100644 index 00000000..59c2def9 --- /dev/null +++ b/src/Utils/AbiDecoder.php @@ -0,0 +1,209 @@ +stripHexPrefix($data); + + $functionSelector = substr($data, 0, 8); + + $abiItem = $this->findFunctionBySelector($functionSelector); + if (! $abiItem) { + throw new Exception('Function selector not found in ABI: '.$functionSelector); + } + + $encodedParams = substr($data, 8); + $decodedParams = $this->decodeAbiParameters($abiItem['inputs'], $encodedParams); + + return [ + 'functionName' => $abiItem['name'], + 'args' => $decodedParams, + ]; + } + + private function findFunctionBySelector(string $selector): ?array + { + foreach ($this->abi as $item) { + if ($item['type'] === 'function') { + $functionSignature = $this->getFunctionSignature($item); + $functionSelector = substr($this->keccak256($functionSignature), 2, 8); + if ($functionSelector === $selector) { + return $item; + } + } + } + + return null; + } + + private function decodeAbiParameters(array $params, string $data): array + { + if (empty($data) && count($params) > 0) { + throw new Exception('No data to decode'); + } + + $bytes = hex2bin($data); + $cursor = 0; + + $values = []; + foreach ($params as $param) { + list($value, $consumed) = $this->decodeParameter($bytes, $cursor, $param); + $cursor += $consumed; + $values[] = $value; + } + + return $values; + } + + private function decodeParameter(string $bytes, int $offset, array $param): array + { + $type = $param['type']; + $arrayComponents = $this->getArrayComponents($type); + if ($arrayComponents) { + list($length, $baseType) = $arrayComponents; + $param['type'] = $baseType; + + return $this->decodeArray($bytes, $offset, $param, $length); + } + + switch ($type) { + case 'address': + return $this->decodeAddress($bytes, $offset); + case 'bool': + return $this->decodeBool($bytes, $offset); + case 'string': + return $this->decodeString($bytes, $offset); + case 'bytes': + return $this->decodeDynamicBytes($bytes, $offset); + default: + if (preg_match('/^bytes(\d+)$/', $type, $matches)) { + $size = intval($matches[1]); + + return $this->decodeFixedBytes($bytes, $offset, $size); + } elseif (preg_match('/^(u?int)(\d+)$/', $type, $matches)) { + $signed = $matches[1] === 'int'; + $bits = intval($matches[2]); + + return $this->decodeNumber($bytes, $offset, $bits, $signed); + } elseif ($type === 'tuple') { + return $this->decodeTuple($bytes, $offset, $param); + } + + throw new Exception('Unsupported type: '.$type); + } + } + + private function decodeAddress(string $bytes, int $offset): array + { + $data = substr($bytes, $offset, 32); + $addressBytes = substr($data, 12, 20); + $address = Address::toChecksumAddress('0x'.bin2hex($addressBytes)); + + return [$address, 32]; + } + + private function decodeBool(string $bytes, int $offset): array + { + $data = substr($bytes, $offset, 32); + $value = hexdec(bin2hex($data)) !== 0; + + return [$value, 32]; + } + + private function decodeNumber(string $bytes, int $offset, int $bits, bool $signed): array + { + $data = substr($bytes, $offset, 32); + $hex = bin2hex($data); + $value = gmp_import(hex2bin($hex), 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); + if ($signed && gmp_testbit($value, $bits - 1)) { + $value = gmp_sub($value, gmp_pow(2, $bits)); + } + + return [gmp_strval($value), 32]; + } + + private function decodeString(string $bytes, int $offset): array + { + $dataOffset = $this->readUInt($bytes, $offset); + $stringOffset = $offset + $dataOffset; + $length = $this->readUInt($bytes, $stringOffset); + $stringData = substr($bytes, $stringOffset + 32, $length); + $value = $stringData; + + return [$value, 32]; + } + + private function decodeDynamicBytes(string $bytes, int $offset): array + { + $dataOffset = $this->readUInt($bytes, $offset); + $bytesOffset = $offset + $dataOffset; + $length = $this->readUInt($bytes, $bytesOffset); + $bytesData = substr($bytes, $bytesOffset + 32, $length); + $value = '0x'.bin2hex($bytesData); + + return [$value, 32]; + } + + private function decodeFixedBytes(string $bytes, int $offset, int $size): array + { + $data = substr($bytes, $offset, 32); + $value = '0x'.substr(bin2hex($data), 0, $size * 2); + + return [$value, 32]; + } + + private function decodeArray(string $bytes, int $offset, array $param, ?int $length): array + { + $baseType = $param['type']; + $elementType = $param; + $elementType['type'] = $baseType; + + if ($length === null) { + $dataOffset = $this->readUInt($bytes, $offset); + $arrayOffset = $offset + $dataOffset; + $arrayLength = $this->readUInt($bytes, $arrayOffset); + $cursor = $arrayOffset + 32; + } else { + $arrayLength = $length; + $cursor = $offset; + } + + $values = []; + for ($i = 0; $i < $arrayLength; $i++) { + list($value, $consumed) = $this->decodeParameter($bytes, $cursor, $elementType); + $cursor += $consumed; + $values[] = $value; + } + + return [$values, 32]; + } + + private function decodeTuple(string $bytes, int $offset, array $param): array + { + $components = $param['components']; + $values = []; + $cursor = $offset; + + foreach ($components as $component) { + list($value, $consumed) = $this->decodeParameter($bytes, $cursor, $component); + $cursor += $consumed; + $values[$component['name'] ?? ''] = $value; + } + + return [$values, 32]; + } + + private function readUInt(string $bytes, int $offset): int + { + $data = substr($bytes, $offset, 32); + + return hexdec(bin2hex($data)); + } +} diff --git a/src/Utils/AbiEncoder.php b/src/Utils/AbiEncoder.php new file mode 100644 index 00000000..f98798ec --- /dev/null +++ b/src/Utils/AbiEncoder.php @@ -0,0 +1,362 @@ + $this->abi, + 'functionName' => $functionName, + 'args' => $args, + ]; + + return $this->encodeFunctionData($parameters); + } + + private function encodeFunctionData(array $parameters): string + { + $args = $parameters['args'] ?? []; + + list($abiItem, $functionName) = (function () use ($parameters) { + if ( + count($parameters['abi']) === 1 && + isset($parameters['functionName']) && + substr($parameters['functionName'], 0, 2) === '0x' + ) { + return [$parameters['abi'][0], $parameters['functionName']]; + } + + return $this->prepareEncodeFunctionData($parameters); + })(); + + $signature = $functionName; + + if (! empty($abiItem['inputs'])) { + $data = $this->encodeAbiParameters($abiItem['inputs'], $args); + } else { + $data = null; + } + + return $this->concatHex([$signature, $data ?? '0x']); + } + + private function prepareEncodeFunctionData(array $params): array + { + $abi = $params['abi']; + $functionName = $params['functionName'] ?? null; + + if (! $functionName) { + $functions = array_filter($abi, function ($item) { + return $item['type'] === 'function'; + }); + if (count($functions) === 1) { + $abiItem = array_values($functions)[0]; + $functionName = $abiItem['name']; + } else { + throw new Exception('Function name is not provided and ABI has multiple functions'); + } + } + + $abiItem = $this->getAbiItem($abi, $functionName, $params['args'] ?? []); + if (! $abiItem) { + throw new Exception('Function not found in ABI: '.$functionName); + } + + $signature = $this->toFunctionSelector($abiItem); + + return [$abiItem, $signature]; + } + + private function getAbiItem(array $abi, string $name, array $args): array + { + $matchingItems = array_filter($abi, function ($item) use ($name) { + return $item['type'] === 'function' && $item['name'] === $name; + }); + + if (count($matchingItems) === 0) { + throw new Exception("Function not found in ABI: $name"); + } + + foreach ($matchingItems as $item) { + $inputs = $item['inputs']; + if (count($inputs) === count($args)) { + return $item; + } + } + + throw new Exception("Function with matching arguments not found in ABI: $name"); + } + + private function encodeAbiParameters(array $params, array $values): string + { + if (count($params) !== count($values)) { + throw new Exception('Length of parameters and values do not match'); + } + + $preparedParams = $this->prepareParams($params, $values); + $data = $this->encodeParams($preparedParams); + + return $data !== '' ? $data : '0x'; + } + + private function prepareParams(array $params, array $values): array + { + $preparedParams = []; + foreach ($params as $index => $param) { + $preparedParam = $this->prepareParam($param, $values[$index]); + $preparedParams[] = $preparedParam; + } + + return $preparedParams; + } + + private function prepareParam(array $param, $value): array + { + $arrayComponents = $this->getArrayComponents($param['type']); + if ($arrayComponents) { + list($length, $type) = $arrayComponents; + + return $this->encodeArray($value, $length, ['name' => $param['name'], 'type' => $type]); + } + if ($param['type'] === 'tuple') { + return $this->encodeTuple($value, $param); + } + if ($param['type'] === 'address') { + return $this->encodeAddress($value); + } + if ($param['type'] === 'bool') { + return $this->encodeBool($value); + } + if (str_starts_with($param['type'], 'uint') || str_starts_with($param['type'], 'int')) { + $signed = str_starts_with($param['type'], 'int'); + + return $this->encodeNumber($value, $signed); + } + if (str_starts_with($param['type'], 'bytes')) { + return $this->encodeBytes($value, $param); + } + if ($param['type'] === 'string') { + return $this->encodeString($value); + } + + throw new Exception('Invalid ABI type: '.$param['type']); + } + + private function encodeArray($value, ?int $length, array $param): array + { + $dynamic = $length === null; + + if (! is_array($value)) { + throw new Exception('Invalid array value'); + } + if (! $dynamic && count($value) !== $length) { + throw new Exception('Array length mismatch'); + } + + $dynamicChild = false; + $preparedParams = []; + foreach ($value as $v) { + $preparedParam = $this->prepareParam($param, $v); + if ($preparedParam['dynamic']) { + $dynamicChild = true; + } + $preparedParams[] = $preparedParam; + } + + if ($dynamic || $dynamicChild) { + $data = $this->encodeParams($preparedParams); + if ($dynamic) { + $lengthHex = str_pad(dechex(count($preparedParams)), 64, '0', STR_PAD_LEFT); + + return [ + 'dynamic' => true, + 'encoded' => '0x'.$lengthHex.substr($data, 2), + ]; + } + if ($dynamicChild) { + return [ + 'dynamic' => true, + 'encoded' => $data, + ]; + } + } + $encoded = ''; + foreach ($preparedParams as $p) { + $encoded .= substr($p['encoded'], 2); + } + + return [ + 'dynamic' => false, + 'encoded' => '0x'.$encoded, + ]; + } + + private function encodeParams(array $preparedParams): string + { + $staticSize = 0; + foreach ($preparedParams as $param) { + $staticSize += $param['dynamic'] ? 32 : (strlen($param['encoded']) - 2) / 2; + } + + $staticParams = []; + $dynamicParams = []; + $dynamicSize = 0; + foreach ($preparedParams as $param) { + if ($param['dynamic']) { + $offset = str_pad(dechex($staticSize + $dynamicSize), 64, '0', STR_PAD_LEFT); + $staticParams[] = $offset; + $dynamicParams[] = substr($param['encoded'], 2); + $dynamicSize += (strlen($param['encoded']) - 2) / 2; + } else { + $staticParams[] = substr($param['encoded'], 2); + } + } + + $encoded = '0x'.implode('', $staticParams).implode('', $dynamicParams); + + return $encoded; + } + + private function encodeAddress(string $value): array + { + if (! $this->isValidAddress($value)) { + throw new Exception('Invalid address: '.$value); + } + $value = strtolower(substr($value, 2)); + + return [ + 'dynamic' => false, + 'encoded' => '0x'.str_pad($value, 64, '0', STR_PAD_LEFT), + ]; + } + + private function encodeBool(bool $value): array + { + $encoded = str_pad($value ? '1' : '0', 64, '0', STR_PAD_LEFT); + + return [ + 'dynamic' => false, + 'encoded' => '0x'.$encoded, + ]; + } + + private function encodeNumber($value, bool $signed): array + { + if (! is_numeric($value)) { + throw new Exception('Invalid number value'); + } + if ($signed) { + $gmpValue = gmp_init($value, 10); + if (gmp_cmp($gmpValue, 0) < 0) { + $gmpValue = gmp_add(gmp_pow(2, 256), $gmpValue); + } + } else { + if ($value < 0) { + throw new Exception('Negative value provided for unsigned integer type'); + } + $gmpValue = gmp_init($value, 10); + } + $hex = gmp_strval($gmpValue, 16); + $encoded = str_pad($hex, 64, '0', STR_PAD_LEFT); + + return [ + 'dynamic' => false, + 'encoded' => '0x'.$encoded, + ]; + } + + private function encodeBytes(string $value, array $param): array + { + $bytesSize = (strlen($value) - 2) / 2; + $paramSizeStr = substr($param['type'], 5); + if ($paramSizeStr === '') { + $lengthHex = str_pad(dechex($bytesSize), 64, '0', STR_PAD_LEFT); + $valuePadded = $value; + $padding = (32 - ($bytesSize % 32)) % 32; + if ($padding > 0) { + $valuePadded .= str_repeat('0', $padding * 2); + } + + return [ + 'dynamic' => true, + 'encoded' => '0x'.$lengthHex.substr($valuePadded, 2), + ]; + } + $paramSize = intval($paramSizeStr); + if ($bytesSize !== $paramSize) { + throw new Exception("Bytes size mismatch: expected $paramSize, got $bytesSize"); + } + $valuePadded = str_pad(substr($value, 2), 64, '0', STR_PAD_RIGHT); + + return [ + 'dynamic' => false, + 'encoded' => '0x'.$valuePadded, + ]; + } + + private function encodeString(string $value): array + { + $hexValue = bin2hex($value); + $lengthHex = str_pad(dechex(strlen($value)), 64, '0', STR_PAD_LEFT); + $valuePadded = $hexValue; + $padding = (32 - (strlen($value) % 32)) % 32; + if ($padding > 0) { + $valuePadded .= str_repeat('00', $padding); + } + + return [ + 'dynamic' => true, + 'encoded' => '0x'.$lengthHex.$valuePadded, + ]; + } + + private function encodeTuple($value, array $param): array + { + $dynamic = false; + $preparedParams = []; + foreach ($param['components'] as $index => $component) { + $key = is_array($value) ? $index : $component['name']; + if (! isset($value[$key])) { + throw new Exception('Tuple value missing component: '.$component['name']); + } + $preparedParam = $this->prepareParam($component, $value[$key]); + if ($preparedParam['dynamic']) { + $dynamic = true; + } + $preparedParams[] = $preparedParam; + } + if ($dynamic) { + $encoded = $this->encodeParams($preparedParams); + + return [ + 'dynamic' => true, + 'encoded' => $encoded, + ]; + } + $encoded = '0x'.implode('', array_map(fn ($p) => substr($p['encoded'], 2), $preparedParams)); + + return [ + 'dynamic' => false, + 'encoded' => $encoded, + ]; + } + + private function concatHex(array $hexes): string + { + $result = '0x'; + foreach ($hexes as $hex) { + if (empty($hex) || $hex === '0x') { + continue; + } + $result .= $this->stripHexPrefix($hex); + } + + return $result; + } +} diff --git a/tests/Concerns/Serialize.php b/tests/Concerns/Serialize.php index f67f2e03..732add78 100644 --- a/tests/Concerns/Serialize.php +++ b/tests/Concerns/Serialize.php @@ -4,16 +4,13 @@ namespace ArkEcosystem\Tests\Crypto\Concerns; -use ArkEcosystem\Crypto\Enums\Types; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; trait Serialize { - protected function assertSerialized(array $fixture): void + protected function assertSerialized(AbstractTransaction $transaction, array $fixture): void { - $data = $fixture['data']; - $transactionClass = Types::fromValue($fixture['data']['type'])->transactionClass(); - $transaction = new $transactionClass(); - $transaction->data = $data; + $transaction->data = $fixture['data']; $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); } diff --git a/tests/Unit/Transactions/Builder/EvmCallBuilderTest.php b/tests/Unit/Transactions/Builder/EvmCallBuilderTest.php index d2261e2d..1d02acb3 100644 --- a/tests/Unit/Transactions/Builder/EvmCallBuilderTest.php +++ b/tests/Unit/Transactions/Builder/EvmCallBuilderTest.php @@ -8,7 +8,7 @@ use ArkEcosystem\Tests\Crypto\TestCase; /** - * @covers \ArkEcosystem\Crypto\Transactions\Builder\MultiPaymentBuilder + * @covers \ArkEcosystem\Crypto\Transactions\Builder\EvmCallBuilder */ class EvmCallBuilderTest extends TestCase { @@ -18,11 +18,11 @@ public function it_should_sign_it_with_a_passphrase() $fixture = $this->getTransactionFixture('evm_call', 'evm-sign'); $builder = EvmCallBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork(30) + ->fee($fixture['data']['fee']) + ->nonce($fixture['data']['nonce']) + ->network(30) ->payload($fixture['data']['asset']['evmCall']['payload']) - ->withGasLimit($fixture['data']['asset']['evmCall']['gasLimit']) + ->gasLimit($fixture['data']['asset']['evmCall']['gasLimit']) ->sign($this->passphrase); $this->assertTrue($builder->verify()); @@ -34,11 +34,11 @@ public function it_should_sign_it_with_a_passphrase_and_contract() $fixture = $this->getTransactionFixture('evm_call', 'evm-with-contract'); $builder = EvmCallBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork(30) + ->fee($fixture['data']['fee']) + ->nonce($fixture['data']['nonce']) + ->network(30) ->payload($fixture['data']['asset']['evmCall']['payload']) - ->withGasLimit($fixture['data']['asset']['evmCall']['gasLimit']) + ->gasLimit($fixture['data']['asset']['evmCall']['gasLimit']) // RecipientId is the contractId ->recipient($fixture['data']['recipientId']) ->sign($this->passphrase); diff --git a/tests/Unit/Transactions/Builder/MultiPaymentTest.php b/tests/Unit/Transactions/Builder/MultiPaymentTest.php deleted file mode 100644 index 02d31add..00000000 --- a/tests/Unit/Transactions/Builder/MultiPaymentTest.php +++ /dev/null @@ -1,94 +0,0 @@ -add('0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A', '100000000') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-multi-sign'); - - $builder = MultiPaymentBuilder::new() - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = MultiPaymentBuilder::new() - ->add('0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A', '100000000') - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-sign'); - $builder = MultiPaymentBuilder::new() - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-with-vendor-field-sign'); - unset($fixture['data']['vendorFieldHex']); - $builder = MultiPaymentBuilder::new() - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php deleted file mode 100644 index ae56e3fb..00000000 --- a/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php +++ /dev/null @@ -1,74 +0,0 @@ -getTransactionFixture('multi_signature_registration', 'multi-signature-registration-sign'); - - $transaction = MultiSignatureRegistrationBuilder::new() - ->multiSignatureAsset([ - 'min' => $fixture['data']['asset']['multiSignature']['min'], - 'publicKeys' => $fixture['data']['asset']['multiSignature']['publicKeys'], - ]) - ->sign('secret'); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration-sign'); - - $transaction = MultiSignatureRegistrationBuilder::new() - ->multiSignatureAsset([ - 'min' => $fixture['data']['asset']['multiSignature']['min'], - 'publicKeys' => $fixture['data']['asset']['multiSignature']['publicKeys'], - ]) - ->sign('secret') - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration-sign'); - - $builder = MultiSignatureRegistrationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->multiSignatureAsset([ - 'min' => $fixture['data']['asset']['multiSignature']['min'], - 'publicKeys' => $fixture['data']['asset']['multiSignature']['publicKeys'], - ]); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $serialized = $builder->transaction->serialize()->getHex(); - $this->assertTrue($builder->verify()); - $this->assertSameSerializationMultisignature($fixture['serialized'], $serialized, 3); - $this->assertSignaturesAreSerialized($serialized, $builder->transaction->data['signatures']); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/TransferTest.php b/tests/Unit/Transactions/Builder/TransferTest.php deleted file mode 100644 index f49cdd0c..00000000 --- a/tests/Unit/Transactions/Builder/TransferTest.php +++ /dev/null @@ -1,104 +0,0 @@ -recipient('0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A') - ->amount('133380000000') - ->vendorField('This is a transaction from PHP') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-multi-sign'); - - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = TransferBuilder::new() - ->recipient('0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A') - ->amount('133380000000') - ->vendorField('This is a transaction from PHP') - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-sign'); - - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); - unset($fixture['data']['vendorFieldHex']); - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/UsernameRegistrationTest.php b/tests/Unit/Transactions/Builder/UsernameRegistrationTest.php deleted file mode 100644 index 448124e7..00000000 --- a/tests/Unit/Transactions/Builder/UsernameRegistrationTest.php +++ /dev/null @@ -1,77 +0,0 @@ -usernameAsset('alfonsobries') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('username_registration', 'username-registration-multi-sign'); - - $builder = UsernameRegistrationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->usernameAsset($fixture['data']['asset']['username']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = UsernameRegistrationBuilder::new() - ->usernameAsset('alfonsobries') - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('username_registration', 'username-registration-sign'); - - $builder = UsernameRegistrationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->usernameAsset($fixture['data']['asset']['username']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/UsernameResignationTest.php b/tests/Unit/Transactions/Builder/UsernameResignationTest.php deleted file mode 100644 index 3c45c8b9..00000000 --- a/tests/Unit/Transactions/Builder/UsernameResignationTest.php +++ /dev/null @@ -1,73 +0,0 @@ -sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('username_resignation', 'username-resignation-multi-sign'); - - $builder = UsernameResignationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = UsernameResignationBuilder::new() - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('username_resignation', 'username-resignation-sign'); - - $builder = UsernameResignationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/ValidatorRegistrationTest.php b/tests/Unit/Transactions/Builder/ValidatorRegistrationTest.php deleted file mode 100644 index 1f68b0d3..00000000 --- a/tests/Unit/Transactions/Builder/ValidatorRegistrationTest.php +++ /dev/null @@ -1,77 +0,0 @@ -publicKeyAsset('a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d3141118') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('validator_registration', 'validator-registration-multi-sign'); - - $builder = ValidatorRegistrationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->publicKeyAsset($fixture['data']['asset']['validatorPublicKey']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = ValidatorRegistrationBuilder::new() - ->publicKeyAsset('a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d3141118') - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('validator_registration', 'validator-registration-sign'); - - $builder = ValidatorRegistrationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->publicKeyAsset($fixture['data']['asset']['validatorPublicKey']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/ValidatorResignationTest.php b/tests/Unit/Transactions/Builder/ValidatorResignationTest.php deleted file mode 100644 index cbe59be8..00000000 --- a/tests/Unit/Transactions/Builder/ValidatorResignationTest.php +++ /dev/null @@ -1,71 +0,0 @@ -sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('validator_resignation', 'validator-resignation-multi-sign'); - $builder = ValidatorResignationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = ValidatorResignationBuilder::new() - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('validator_resignation', 'validator-resignation-sign'); - $builder = ValidatorResignationBuilder::new() - ->withFee($fixture['data']['fee']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/Builder/VoteTest.php b/tests/Unit/Transactions/Builder/VoteTest.php deleted file mode 100644 index a2dc3d6f..00000000 --- a/tests/Unit/Transactions/Builder/VoteTest.php +++ /dev/null @@ -1,74 +0,0 @@ -votes(['03f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc']) - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_multi_sign() - { - $fixture = $this->getTransactionFixture('vote', 'vote-multi-sign'); - $builder = VoteBuilder::new() - ->votes($fixture['data']['asset']['votes']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']); - - foreach ($this->passphrases as $index => $passphrase) { - $builder->multiSign($passphrase, $index); - } - - $builder->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - - $this->assertSameSerializationMultisignature($fixture['serialized'], $builder->transaction->serialize()->getHex(), 3); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - public function it_should_sign_it_with_a_second_passphrase() - { - $transaction = VoteBuilder::new() - ->votes(['03f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($this->secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('vote', 'vote-sign'); - $builder = VoteBuilder::new() - ->votes($fixture['data']['asset']['votes']) - ->withNonce($fixture['data']['nonce']) - ->withNetwork($fixture['data']['network']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSameSerialization($fixture['serialized'], $builder->transaction->serialize()->getHex()); - - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} diff --git a/tests/Unit/Transactions/DeserializerTest.php b/tests/Unit/Transactions/DeserializerTest.php new file mode 100644 index 00000000..989e66eb --- /dev/null +++ b/tests/Unit/Transactions/DeserializerTest.php @@ -0,0 +1,87 @@ +getTransactionFixture('evm_call', 'transfer'); + + $transaction = $this->assertTransaction($fixture); + + expect($transaction->data['amount'])->toEqual('100000000'); + + expect($transaction)->toBeInstanceOf(Transfer::class); + } + + /** @test */ + public function it_should_deserialize_a_vote_signed_with_a_passphrase() + { + $fixture = $this->getTransactionFixture('evm_call', 'vote'); + + $transaction = $this->assertTransaction($fixture); + + expect($transaction->data['asset']['vote'])->toEqual('0x512F366D524157BcF734546eB29a6d687B762255'); + + expect($transaction)->toBeInstanceOf(Vote::class); + } + + /** @test */ + public function it_should_deserialize_a_unvote_signed_with_a_passphrase() + { + $fixture = $this->getTransactionFixture('evm_call', 'unvote'); + + $transaction = $this->assertTransaction($fixture); + + expect($transaction)->toBeInstanceOf(Unvote::class); + } + + /** @test */ + public function it_should_deserialize_a_validator_registration_signed_with_a_passphrase() + { + $fixture = $this->getTransactionFixture('evm_call', 'validator-registration'); + + $transaction = $this->assertTransaction($fixture); + + expect($transaction)->toBeInstanceOf(ValidatorRegistration::class); + } + + /** @test */ + public function it_should_deserialize_a_validator_resignation_signed_with_a_passphrase() + { + $fixture = $this->getTransactionFixture('evm_call', 'validator-resignation'); + + $transaction = $this->assertTransaction($fixture); + + expect($transaction)->toBeInstanceOf(ValidatorResignation::class); + } + + private function assertTransaction(array $fixture): AbstractTransaction + { + $actual = $this->assertDeserialized($fixture, [ + 'nonce', + 'fee', + 'gasLimit', + 'contractId', + ]); + + $this->assertTrue($actual->verify()); + + return $actual; + } +} diff --git a/tests/Unit/Transactions/Deserializers/EvmCallBuilderTest.php b/tests/Unit/Transactions/Deserializers/EvmCallBuilderTest.php deleted file mode 100644 index dfc9c131..00000000 --- a/tests/Unit/Transactions/Deserializers/EvmCallBuilderTest.php +++ /dev/null @@ -1,44 +0,0 @@ -getTransactionFixture('evm_call', 'evm-sign'); - - $this->assertTransaction($fixture); - } - - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_contract() - { - $fixture = $this->getTransactionFixture('evm_call', 'evm-with-contract'); - - $this->assertTransaction($fixture); - } - - private function assertTransaction(array $fixture): EvmCall - { - $actual = $this->assertDeserialized($fixture, [ - 'nonce', - 'fee', - 'gasLimit', - 'contractId', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php b/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php deleted file mode 100644 index f99d359e..00000000 --- a/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getTransactionFixture('multi_payment', 'multi-payment-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): MultiPayment - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php deleted file mode 100644 index 172b8fd3..00000000 --- a/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getTransactionFixture('multi_signature_registration', 'multi-signature-registration-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): MultiSignatureRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/TransferTest.php b/tests/Unit/Transactions/Deserializers/TransferTest.php deleted file mode 100644 index 5c7866b8..00000000 --- a/tests/Unit/Transactions/Deserializers/TransferTest.php +++ /dev/null @@ -1,53 +0,0 @@ -getTransactionFixture('transfer', 'transfer-sign'); - - $actual = $this->assertTransaction($fixture); - $this->assertSame(0, $actual->data['expiration']); - } - - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase_and_vendor_field() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); - - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['vendorField'], $actual->data['vendorField']); - } - - private function assertTransaction(array $fixture): Transfer - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/UsernameRegistrationTest.php b/tests/Unit/Transactions/Deserializers/UsernameRegistrationTest.php deleted file mode 100644 index 94688cd7..00000000 --- a/tests/Unit/Transactions/Deserializers/UsernameRegistrationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -getTransactionFixture('username_registration', 'username-registration-sign'); - - $this->assertTransaction($fixture); - } - - private function assertTransaction(array $fixture): UsernameRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/UsernameResignationTest.php b/tests/Unit/Transactions/Deserializers/UsernameResignationTest.php deleted file mode 100644 index 022652bf..00000000 --- a/tests/Unit/Transactions/Deserializers/UsernameResignationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -getTransactionFixture('username_resignation', 'username-resignation-sign'); - - $this->assertTransaction($fixture); - } - - private function assertTransaction(array $fixture): UsernameResignation - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/ValidatorRegistrationTest.php b/tests/Unit/Transactions/Deserializers/ValidatorRegistrationTest.php deleted file mode 100644 index c57b6a1b..00000000 --- a/tests/Unit/Transactions/Deserializers/ValidatorRegistrationTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getTransactionFixture('validator_registration', 'validator-registration-sign'); - - $this->assertTransaction($fixture); - } - - private function assertTransaction(array $fixture): ValidatorRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/ValidatorResignationTest.php b/tests/Unit/Transactions/Deserializers/ValidatorResignationTest.php deleted file mode 100644 index d2b9fb94..00000000 --- a/tests/Unit/Transactions/Deserializers/ValidatorResignationTest.php +++ /dev/null @@ -1,44 +0,0 @@ -getTransactionFixture('validator_resignation', 'validator-resignation-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): ValidatorResignation - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/Deserializers/VoteTest.php b/tests/Unit/Transactions/Deserializers/VoteTest.php deleted file mode 100644 index 932dd057..00000000 --- a/tests/Unit/Transactions/Deserializers/VoteTest.php +++ /dev/null @@ -1,43 +0,0 @@ -getTransactionFixture('vote', 'vote-sign'); - - $this->assertTransaction($fixture); - } - - private function assertTransaction(array $fixture): Vote - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } -} diff --git a/tests/Unit/Transactions/SerializerTest.php b/tests/Unit/Transactions/SerializerTest.php new file mode 100644 index 00000000..a64ec1f1 --- /dev/null +++ b/tests/Unit/Transactions/SerializerTest.php @@ -0,0 +1,68 @@ +getTransactionFixture('evm_call', 'transfer'); + + $transaction = new Transfer($fixture['data']); + + $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); + } + + /** @test */ + public function it_should_serialize_a_vote_transaction() + { + $fixture = $this->getTransactionFixture('evm_call', 'vote'); + + $transaction = new Vote($fixture['data']); + + $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); + } + + /** @test */ + public function it_should_serialize_a_unvote_transaction() + { + $fixture = $this->getTransactionFixture('evm_call', 'unvote'); + + $transaction = new Unvote($fixture['data']); + + $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); + } + + /** @test */ + public function it_should_serialize_a_validator_registration_transaction() + { + $fixture = $this->getTransactionFixture('evm_call', 'validator-registration'); + + $transaction = new ValidatorRegistration($fixture['data']); + + $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); + } + + /** @test */ + public function it_should_serialize_a_validator_resignation_transaction() + { + $fixture = $this->getTransactionFixture('evm_call', 'validator-resignation'); + + $transaction = new ValidatorResignation($fixture['data']); + + $this->assertSame($fixture['serialized'], $transaction->serialize()->getHex()); + } +} diff --git a/tests/Unit/Transactions/Serializers/EvmCallBuilderTest.php b/tests/Unit/Transactions/Serializers/EvmCallBuilderTest.php deleted file mode 100644 index 664b828a..00000000 --- a/tests/Unit/Transactions/Serializers/EvmCallBuilderTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertSerialized($this->getTransactionFixture('evm_call', 'evm-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase_and_contract_id() - { - $this->assertSerialized($this->getTransactionFixture('evm_call', 'evm-with-contract')); - } -} diff --git a/tests/Unit/Transactions/Serializers/MultiPaymentTest.php b/tests/Unit/Transactions/Serializers/MultiPaymentTest.php deleted file mode 100644 index d21e8a99..00000000 --- a/tests/Unit/Transactions/Serializers/MultiPaymentTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('multi_payment', 'multi-payment-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php deleted file mode 100644 index 9d0e8f4e..00000000 --- a/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/TransferTest.php b/tests/Unit/Transactions/Serializers/TransferTest.php deleted file mode 100644 index 74484e07..00000000 --- a/tests/Unit/Transactions/Serializers/TransferTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertSerialized($this->getTransactionFixture('transfer', 'transfer-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase_and_vendor_field() - { - $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/UsernameRegistrationTest.php b/tests/Unit/Transactions/Serializers/UsernameRegistrationTest.php deleted file mode 100644 index e0a6d482..00000000 --- a/tests/Unit/Transactions/Serializers/UsernameRegistrationTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('username_registration', 'username-registration-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/UsernameResignationTest.php b/tests/Unit/Transactions/Serializers/UsernameResignationTest.php deleted file mode 100644 index efd21fac..00000000 --- a/tests/Unit/Transactions/Serializers/UsernameResignationTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('username_resignation', 'username-resignation-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/ValidatorRegistrationTest.php b/tests/Unit/Transactions/Serializers/ValidatorRegistrationTest.php deleted file mode 100644 index e2e4aa55..00000000 --- a/tests/Unit/Transactions/Serializers/ValidatorRegistrationTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('validator_registration', 'validator-registration-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/ValidatorResignationTest.php b/tests/Unit/Transactions/Serializers/ValidatorResignationTest.php deleted file mode 100644 index e5c772bb..00000000 --- a/tests/Unit/Transactions/Serializers/ValidatorResignationTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('validator_resignation', 'validator-resignation-sign')); - } -} diff --git a/tests/Unit/Transactions/Serializers/VoteTest.php b/tests/Unit/Transactions/Serializers/VoteTest.php deleted file mode 100644 index dfd0780a..00000000 --- a/tests/Unit/Transactions/Serializers/VoteTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSerialized($this->getTransactionFixture('vote', 'vote-sign')); - } -} diff --git a/tests/Unit/Transactions/TransactionTest.php b/tests/Unit/Transactions/TransactionTest.php index cb32c79c..7a301816 100644 --- a/tests/Unit/Transactions/TransactionTest.php +++ b/tests/Unit/Transactions/TransactionTest.php @@ -6,7 +6,7 @@ use ArkEcosystem\Crypto\Identities\PrivateKey; use ArkEcosystem\Crypto\Transactions\Deserializer; -use ArkEcosystem\Crypto\Transactions\Types\Transfer; +use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction; use ArkEcosystem\Tests\Crypto\TestCase; use BitWasp\Buffertools\Buffer; @@ -68,9 +68,9 @@ public function should_turn_the_transaction_to_json() $this->assertIsString($actual); } - private function getTransaction($file = 'transfer-sign'): Transfer + private function getTransaction($file = 'transfer'): AbstractTransaction { - $fixture = $this->getTransactionFixture('transfer', $file); + $fixture = $this->getTransactionFixture('evm_call', $file); return Deserializer::new($fixture['serialized'])->deserialize(); } diff --git a/tests/Unit/Utils/AbiDecoderTest.php b/tests/Unit/Utils/AbiDecoderTest.php new file mode 100644 index 00000000..bd290b10 --- /dev/null +++ b/tests/Unit/Utils/AbiDecoderTest.php @@ -0,0 +1,36 @@ +decoder = new AbiDecoder(); + } + + /** @test */ + public function it_should_decode_vote_payload() + { + $functionName = 'vote'; + $args = ['0x512F366D524157BcF734546eB29a6d687B762255']; + $data = '0x6dd7d8ea000000000000000000000000512f366d524157bcf734546eb29a6d687b762255'; + + $decodedData = $this->decoder->decodeFunctionData($data); + + $this->assertSame($decodedData, [ + 'functionName' => $functionName, + 'args' => $args, + ]); + } +} diff --git a/tests/Unit/Utils/AbiEncoderTest.php b/tests/Unit/Utils/AbiEncoderTest.php new file mode 100644 index 00000000..dec767b1 --- /dev/null +++ b/tests/Unit/Utils/AbiEncoderTest.php @@ -0,0 +1,33 @@ +encoder = new AbiEncoder(); + } + + /** @test */ + public function it_should_encode_vote_function_call() + { + $functionName = 'vote'; + $args = ['0x512F366D524157BcF734546eB29a6d687B762255']; + $expectedEncodedData = '0x6dd7d8ea000000000000000000000000512f366d524157bcf734546eb29a6d687b762255'; + + $encodedData = $this->encoder->encodeFunctionCall($functionName, $args); + + $this->assertSame($expectedEncodedData, $encodedData); + } +} diff --git a/tests/fixtures/transactions/evm_call/transfer.json b/tests/fixtures/transactions/evm_call/transfer.json new file mode 100644 index 00000000..23a1dde4 --- /dev/null +++ b/tests/fixtures/transactions/evm_call/transfer.json @@ -0,0 +1,22 @@ +{ + "data": { + "version": 1, + "network": 30, + "typeGroup": 1, + "type": 10, + "nonce": "0", + "senderPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", + "fee": "5", + "amount": "100000000", + "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A", + "asset": { + "evmCall": { + "gasLimit": 21000, + "payload": "" + } + }, + "signature": "72bc7651a1f8216e06d3a961893f364b2ad6885ebf4f83fbb084a68e846430768c6d792fd829d4e5b7f9422eae9ebcdd7828cd2560f186d69a3698dad594faf3", + "id": "d0a9bb9e9ec2a881717c25b31c70600c9b04c103852f8dfb8e80c7456a9ae24c" + }, + "serialized": "ff011e010000000a00000000000000000003a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd0000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000005f5e10001b693449adda7efc015d87944eae8b7c37eb1690a085200000000000072bc7651a1f8216e06d3a961893f364b2ad6885ebf4f83fbb084a68e846430768c6d792fd829d4e5b7f9422eae9ebcdd7828cd2560f186d69a3698dad594faf3" +} diff --git a/tests/fixtures/transactions/evm_call/unvote.json b/tests/fixtures/transactions/evm_call/unvote.json new file mode 100644 index 00000000..cec9ca06 --- /dev/null +++ b/tests/fixtures/transactions/evm_call/unvote.json @@ -0,0 +1,22 @@ +{ + "data": { + "version": 1, + "network": 30, + "typeGroup": 1, + "type": 10, + "nonce": "0", + "senderPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", + "fee": "5", + "amount": "0", + "recipientId": "0x522B3294E6d06aA25Ad0f1B8891242E335D3B459", + "asset": { + "evmCall": { + "gasLimit": 200000, + "payload": "3174b689" + } + }, + "signature": "311c57715819e18f5da639bf98a185c8628988081932e2d8378ceaa3409f43b49e5fb37298f1b4bdb5a4e7b528343101ee28510d1bb3a8bb14233901a6b57c0a", + "id": "fea7fa3ef6e89720f6286edf3fcd8c8c30f28f07aae441ef6744a135679f7553" + }, + "serialized": "ff011e010000000a00000000000000000003a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000001522b3294e6d06aa25ad0f1b8891242e335d3b459400d0300040000003174b689311c57715819e18f5da639bf98a185c8628988081932e2d8378ceaa3409f43b49e5fb37298f1b4bdb5a4e7b528343101ee28510d1bb3a8bb14233901a6b57c0a" +} diff --git a/tests/fixtures/transactions/evm_call/validator-registration.json b/tests/fixtures/transactions/evm_call/validator-registration.json new file mode 100644 index 00000000..5958c24b --- /dev/null +++ b/tests/fixtures/transactions/evm_call/validator-registration.json @@ -0,0 +1,22 @@ +{ + "data": { + "version": 1, + "network": 30, + "typeGroup": 1, + "type": 10, + "nonce": "0", + "senderPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", + "fee": "5", + "amount": "0", + "recipientId": "0x522B3294E6d06aA25Ad0f1B8891242E335D3B459", + "asset": { + "evmCall": { + "gasLimit": 500000, + "payload": "602a9eee00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d314111800000000000000000000000000000000" + } + }, + "signature": "b044a149fb241243fd5141ea47acfa01166ca869aba9dfbfd4311002fa34d700a9d28399cf2c07dac332463cd64a9f44929bcb0a21aa115dc94df16f311141d8", + "id": "8da99159674742118b89d46ec6e333d7df40139c7472818fd55dc7b612bca1fa" + }, + "serialized": "ff011e010000000a00000000000000000003a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000001522b3294e6d06aa25ad0f1b8891242e335d3b45920a1070084000000602a9eee00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d314111800000000000000000000000000000000b044a149fb241243fd5141ea47acfa01166ca869aba9dfbfd4311002fa34d700a9d28399cf2c07dac332463cd64a9f44929bcb0a21aa115dc94df16f311141d8" +} diff --git a/tests/fixtures/transactions/evm_call/validator-resignation.json b/tests/fixtures/transactions/evm_call/validator-resignation.json new file mode 100644 index 00000000..c35f9f6f --- /dev/null +++ b/tests/fixtures/transactions/evm_call/validator-resignation.json @@ -0,0 +1,22 @@ +{ + "data": { + "version": 1, + "network": 30, + "typeGroup": 1, + "type": 10, + "nonce": "0", + "senderPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", + "fee": "5", + "amount": "0", + "recipientId": "0x522B3294E6d06aA25Ad0f1B8891242E335D3B459", + "asset": { + "evmCall": { + "gasLimit": 150000, + "payload": "b85f5da2" + } + }, + "signature": "c84e7269d8f45364bd9da8bcbb2ae843bcc3e0f49a044832855e86c024c6ff6617cc090acb67551a21537dda0e78c903fbc7c72a0cbb575e0edfbff388547967", + "id": "a521da35fc32122f3d95c63eb500a8c96a5b8ac3139aa5b94ed2f068cf8ed708" + }, + "serialized": "ff011e010000000a00000000000000000003a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000001522b3294e6d06aa25ad0f1b8891242e335d3b459f049020004000000b85f5da2c84e7269d8f45364bd9da8bcbb2ae843bcc3e0f49a044832855e86c024c6ff6617cc090acb67551a21537dda0e78c903fbc7c72a0cbb575e0edfbff388547967" +} diff --git a/tests/fixtures/transactions/evm_call/vote.json b/tests/fixtures/transactions/evm_call/vote.json new file mode 100644 index 00000000..e8fdaf1c --- /dev/null +++ b/tests/fixtures/transactions/evm_call/vote.json @@ -0,0 +1,22 @@ +{ + "data": { + "version": 1, + "network": 30, + "typeGroup": 1, + "type": 10, + "nonce": "0", + "senderPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd", + "fee": "5", + "amount": "0", + "recipientId": "0x522B3294E6d06aA25Ad0f1B8891242E335D3B459", + "asset": { + "evmCall": { + "gasLimit": 200000, + "payload": "6dd7d8ea000000000000000000000000512f366d524157bcf734546eb29a6d687b762255" + } + }, + "signature": "a56ae1e72ef7398baf2ef98d23acefa1c308cf26759585d998b8337368ee094df587b7d824ed1cd423962266ab8f5999abd90294ca6b8c69b82ff3dbf97325af", + "id": "da43c2850565f29cb0dc043cd5ff026aecf89fdf363faaa70af86b143f4289e3" + }, + "serialized": "ff011e010000000a00000000000000000003a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000001522b3294e6d06aa25ad0f1b8891242e335d3b459400d0300240000006dd7d8ea000000000000000000000000512f366d524157bcf734546eb29a6d687b762255a56ae1e72ef7398baf2ef98d23acefa1c308cf26759585d998b8337368ee094df587b7d824ed1cd423962266ab8f5999abd90294ca6b8c69b82ff3dbf97325af" +} diff --git a/tests/fixtures/transactions/multi_payment/multi-payment-multi-sign.json b/tests/fixtures/transactions/multi_payment/multi-payment-multi-sign.json deleted file mode 100644 index 07f4b78b..00000000 --- a/tests/fixtures/transactions/multi_payment/multi-payment-multi-sign.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 6, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "3", - "asset": { - "payments": [ - { - "amount": "1", - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A" - }, - { - "amount": "2", - "recipientId": "0x27FA7CaFFaAE77dDb9AB232FDBDa56D5e5Af2393" - } - ] - }, - "signature": "cf4e94776e768110e62961747f39b68993d4ff5ec2171cad2fab6d77babb2ce31181f005876031d43e6d7732770c6aca73b33057c7aad6279cf2da03829a7b62", - "signatures": [ - "006581c24bbe49e57127604b18d2efdd8d1d2bfe23f9b1e7f15b3f46a647b976e79884b61331546c5844ded781974e181a03a4066f858020fb347ad9628773b465", - "011fb86a8ddbddbed012ff46fc0f3c9a30f3c1544d7a32b9355c318ad453837615e8399f676856c97cf6dcb8d18507ff9c0ffe195d23624e296182477644ed3689", - "023aa80e3663d737716818978ffbae59a8a9f32257a341e1391ca1e0fd744f3382b41e507dca92fa91f98e2024b67938420aaf0c268266dfe4d1f92e81cb3a0421" - ], - "id": "5349b6d57228cb2aeb77e198d6adc93f745e3abb9b4624929b7e29f4a920c0a5" - }, - "serialized": "ff011e0100000006000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d380969800000000000002000100000000000000b693449adda7efc015d87944eae8b7c37eb1690a020000000000000027fa7caffaae77ddb9ab232fdbda56d5e5af2393cf4e94776e768110e62961747f39b68993d4ff5ec2171cad2fab6d77babb2ce31181f005876031d43e6d7732770c6aca73b33057c7aad6279cf2da03829a7b62006581c24bbe49e57127604b18d2efdd8d1d2bfe23f9b1e7f15b3f46a647b976e79884b61331546c5844ded781974e181a03a4066f858020fb347ad9628773b465011fb86a8ddbddbed012ff46fc0f3c9a30f3c1544d7a32b9355c318ad453837615e8399f676856c97cf6dcb8d18507ff9c0ffe195d23624e296182477644ed3689023aa80e3663d737716818978ffbae59a8a9f32257a341e1391ca1e0fd744f3382b41e507dca92fa91f98e2024b67938420aaf0c268266dfe4d1f92e81cb3a0421" -} diff --git a/tests/fixtures/transactions/multi_payment/multi-payment-sign.json b/tests/fixtures/transactions/multi_payment/multi-payment-sign.json deleted file mode 100644 index f936e771..00000000 --- a/tests/fixtures/transactions/multi_payment/multi-payment-sign.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 6, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "3", - "asset": { - "payments": [ - { - "amount": "1", - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A" - }, - { - "amount": "2", - "recipientId": "0x27FA7CaFFaAE77dDb9AB232FDBDa56D5e5Af2393" - } - ] - }, - "signature": "e782cc5a7622ea23463aa3d6795850b7163abf6b02c29795f9230f4b0537404cbccf82de6a44ecf6e98391bff601f033524c8704f4081ada4f72e98aea5ae173", - "id": "c820af7342cde48a2d578e6324329fc557ffb4e40fa3208b348cf07fd2020e43" - }, - "serialized": "ff011e0100000006000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d380969800000000000002000100000000000000b693449adda7efc015d87944eae8b7c37eb1690a020000000000000027fa7caffaae77ddb9ab232fdbda56d5e5af2393e782cc5a7622ea23463aa3d6795850b7163abf6b02c29795f9230f4b0537404cbccf82de6a44ecf6e98391bff601f033524c8704f4081ada4f72e98aea5ae173" -} diff --git a/tests/fixtures/transactions/multi_payment/multi-payment-with-vendor-field-sign.json b/tests/fixtures/transactions/multi_payment/multi-payment-with-vendor-field-sign.json deleted file mode 100644 index 685b9222..00000000 --- a/tests/fixtures/transactions/multi_payment/multi-payment-with-vendor-field-sign.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 6, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "3", - "vendorField": "this is a top secret vendor field", - "asset": { - "payments": [ - { - "amount": "1", - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A" - }, - { - "amount": "2", - "recipientId": "0x27FA7CaFFaAE77dDb9AB232FDBDa56D5e5Af2393" - } - ] - }, - "signature": "ff68aa386548aba97004d99d616d5bdd1f13074dd85fdb0ab636d18585d4436030f66f42fa257c2b18873a076906af31a2b3b838081d9ec79f685f32d4640955", - "id": "4c759d085999e25996e2af264c79aac76c44e48d3f5f2432c56d8a2e4fd99349" - }, - "serialized": "ff011e0100000006000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d380969800000000002174686973206973206120746f70207365637265742076656e646f72206669656c6402000100000000000000b693449adda7efc015d87944eae8b7c37eb1690a020000000000000027fa7caffaae77ddb9ab232fdbda56d5e5af2393ff68aa386548aba97004d99d616d5bdd1f13074dd85fdb0ab636d18585d4436030f66f42fa257c2b18873a076906af31a2b3b838081d9ec79f685f32d4640955" -} diff --git a/tests/fixtures/transactions/multi_signature_registration/multi-signature-registration-sign.json b/tests/fixtures/transactions/multi_signature_registration/multi-signature-registration-sign.json deleted file mode 100644 index bf65bea5..00000000 --- a/tests/fixtures/transactions/multi_signature_registration/multi-signature-registration-sign.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 4, - "nonce": "2", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "500000000", - "amount": "0", - "asset": { - "multiSignature": { - "min": 2, - "publicKeys": [ - "029fab3cb2f5e248ae7cbb4de646741da4d73c493b2a03ab5c71507fb2c0dcca92", - "03629f9dbf7f1e91cefa845126189816ceae357bdd1f41bd14787318a7d5b55d48", - "027941d2059f89a26d89e87d3385e261a0ede1234aaeaa487012b69d6b67962dc5" - ] - } - }, - "signature": "2b33558cdc62933ff56feb646d1f47a98104bf34b894895d5e816f86e556f87fce8485e55aa32dfa1cd86456a66a58ef7a68dff4af51e2f7fcf75b983540872e", - "signatures": [ - "000caa6864c71362b369c71107f463f29c43c361e54260cbc54d791b7385dbe76f29d12b9befbe4f98792d7046481afcf0c156408310192a93d8413e5380438f27", - "0153a22c5ce2b1894f0a141adc19de567077d2d268f4c7e1476e9558ecb4411d486cd0d7aa3e9c7716739a055a8a1a64a162d0362645d63d13791a9876ef8b5a88", - "021d56997f0c9e21201c59e1b7b6be8d5a609908a4f65bf266144baf5e61e3f14bc2651f62187f4ffa17c8b010fcb0fba94a04df56bc25e5cb20935ec5fb7ad632" - ], - "id": "1941926b880ab606633b3a2361df784f6085ded8b5d3cf52e94998e1468b3197" - }, - "serialized": "ff011e0100000004000200000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d30065cd1d00000000000203029fab3cb2f5e248ae7cbb4de646741da4d73c493b2a03ab5c71507fb2c0dcca9203629f9dbf7f1e91cefa845126189816ceae357bdd1f41bd14787318a7d5b55d48027941d2059f89a26d89e87d3385e261a0ede1234aaeaa487012b69d6b67962dc52b33558cdc62933ff56feb646d1f47a98104bf34b894895d5e816f86e556f87fce8485e55aa32dfa1cd86456a66a58ef7a68dff4af51e2f7fcf75b983540872e000caa6864c71362b369c71107f463f29c43c361e54260cbc54d791b7385dbe76f29d12b9befbe4f98792d7046481afcf0c156408310192a93d8413e5380438f270153a22c5ce2b1894f0a141adc19de567077d2d268f4c7e1476e9558ecb4411d486cd0d7aa3e9c7716739a055a8a1a64a162d0362645d63d13791a9876ef8b5a88021d56997f0c9e21201c59e1b7b6be8d5a609908a4f65bf266144baf5e61e3f14bc2651f62187f4ffa17c8b010fcb0fba94a04df56bc25e5cb20935ec5fb7ad632" -} diff --git a/tests/fixtures/transactions/transfer/transfer-multi-sign.json b/tests/fixtures/transactions/transfer/transfer-multi-sign.json deleted file mode 100644 index 1db6a1de..00000000 --- a/tests/fixtures/transactions/transfer/transfer-multi-sign.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 0, - "nonce": "1", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "1", - "expiration": 0, - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A", - "signature": "f25db2b781b79f671b7848284de63f3cb898f9938c0b6203a11cace4aaa4b962eabe9c4a67c207a3f8baea3b4f4cef90a0b67a2bfd84cd61dcc771597f52656d", - "signatures": [ - "005afa0050c85a2ac9b34accb0f47c6a9cc9eee831ac713e62e846898d1b75d6a33034680bce95f638c6dfabf8056f8afa9ef73a3c35741234faf01d0a346e3e7d", - "0104bd019e5a6ea9ee5cc41d9f39efe2a2df2cc653369fdfcb56d5219fa282a8368067586748feb2483883c9eca50a5ae73abd7139d4d1885914ed9d5e5c63f8fb", - "02d6af0f5a85a7967d677b2f1f86e00b8ca37facb714467e12810a692d5bcbdfcac4e4c2d4b79a70c7366405339bf84a854308d20cb48652816a9cf37fb3e86e00" - ], - "id": "dcb9d29590313cf6e1b53f120e621e34c39e45fce9114272158036cb99be9c89" - }, - "serialized": "ff011e0100000000000100000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3809698000000000000010000000000000000000000b693449adda7efc015d87944eae8b7c37eb1690af25db2b781b79f671b7848284de63f3cb898f9938c0b6203a11cace4aaa4b962eabe9c4a67c207a3f8baea3b4f4cef90a0b67a2bfd84cd61dcc771597f52656d005afa0050c85a2ac9b34accb0f47c6a9cc9eee831ac713e62e846898d1b75d6a33034680bce95f638c6dfabf8056f8afa9ef73a3c35741234faf01d0a346e3e7d0104bd019e5a6ea9ee5cc41d9f39efe2a2df2cc653369fdfcb56d5219fa282a8368067586748feb2483883c9eca50a5ae73abd7139d4d1885914ed9d5e5c63f8fb02d6af0f5a85a7967d677b2f1f86e00b8ca37facb714467e12810a692d5bcbdfcac4e4c2d4b79a70c7366405339bf84a854308d20cb48652816a9cf37fb3e86e00" -} diff --git a/tests/fixtures/transactions/transfer/transfer-sign.json b/tests/fixtures/transactions/transfer/transfer-sign.json deleted file mode 100644 index c1032bcf..00000000 --- a/tests/fixtures/transactions/transfer/transfer-sign.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 0, - "nonce": "1", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "1", - "expiration": 0, - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A", - "signature": "97dd98ed1066aab76011114cbf5ac00d741812cac326cda7966e1af08874d7212f350d769221d2a78ea185d77ac4e2c5c718e4a84b1a1ddcbf504d642eb94b6a", - "id": "e20265dba26594c4202e224e8d1069dfae840a8db7cc6acfafefa2b3b02787e5" - }, - "serialized": "ff011e0100000000000100000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3809698000000000000010000000000000000000000b693449adda7efc015d87944eae8b7c37eb1690a97dd98ed1066aab76011114cbf5ac00d741812cac326cda7966e1af08874d7212f350d769221d2a78ea185d77ac4e2c5c718e4a84b1a1ddcbf504d642eb94b6a" -} diff --git a/tests/fixtures/transactions/transfer/transfer-with-vendor-field-sign.json b/tests/fixtures/transactions/transfer/transfer-with-vendor-field-sign.json deleted file mode 100644 index f2f57e11..00000000 --- a/tests/fixtures/transactions/transfer/transfer-with-vendor-field-sign.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 0, - "nonce": "1", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "10000000", - "amount": "1", - "vendorField": "this is a top secret vendor field", - "expiration": 0, - "recipientId": "0xb693449AdDa7EFc015D87944EAE8b7C37EB1690A", - "signature": "d7062dd749406741ab848cc0bb6bcc82c04d8b46b699803154a30bda8d13bd6dc6c06fcbbb6a6edab3b83772008e50524b4563a33c0f08009b4cc72f38986981", - "id": "59cc59e3609f86418ef04fff270fb0f59ea2ff5a383857a3c157056f0925d59d" - }, - "serialized": "ff011e0100000000000100000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d380969800000000002174686973206973206120746f70207365637265742076656e646f72206669656c64010000000000000000000000b693449adda7efc015d87944eae8b7c37eb1690ad7062dd749406741ab848cc0bb6bcc82c04d8b46b699803154a30bda8d13bd6dc6c06fcbbb6a6edab3b83772008e50524b4563a33c0f08009b4cc72f38986981" -} diff --git a/tests/fixtures/transactions/username_registration/username-registration-multi-sign.json b/tests/fixtures/transactions/username_registration/username-registration-multi-sign.json deleted file mode 100644 index 9f69e174..00000000 --- a/tests/fixtures/transactions/username_registration/username-registration-multi-sign.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 8, - "nonce": "6", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "asset": { - "username": "simple_tx_tester" - }, - "signature": "9a74c959d0cd4ad4352292417de3ed8ed0cac9aad390bb5d93a5ef5d2bdbf54dad9bbf690f2079ad397141acd182b6e5c4285bd64b068083431daffd5dbc5b09", - "signatures": [ - "003b5b94d80da3d41f514d77a624f26f7a2336c34ce1ec62f06c61635db31b27135a58b9ee705cbaa45addd6e75098833c80935541ccc050199443a3d4c62c7fdd", - "01335feff7cc3d6e3524dd9892e029d2dea77c76afdeb9445bc0d14c587fd922c6c38e3542b978aeb370dc349b4a1221015f33051407f10ca051a1caa2109fc510", - "02fe8b1d0be5a77455b38f9df31a379e1a80bcab4003a225cbf79d426fcd248e03ff5f499a404d879270086e292aa45ac1af979aa9af4a64e4881ec559fc87e779" - ], - "id": "ffaead0f6003e125bb2a66169e87efe29c05dedaec71898abfcbc7a1f846f2b3" - }, - "serialized": "ff011e0100000008000600000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f9029500000000001073696d706c655f74785f7465737465729a74c959d0cd4ad4352292417de3ed8ed0cac9aad390bb5d93a5ef5d2bdbf54dad9bbf690f2079ad397141acd182b6e5c4285bd64b068083431daffd5dbc5b09003b5b94d80da3d41f514d77a624f26f7a2336c34ce1ec62f06c61635db31b27135a58b9ee705cbaa45addd6e75098833c80935541ccc050199443a3d4c62c7fdd01335feff7cc3d6e3524dd9892e029d2dea77c76afdeb9445bc0d14c587fd922c6c38e3542b978aeb370dc349b4a1221015f33051407f10ca051a1caa2109fc51002fe8b1d0be5a77455b38f9df31a379e1a80bcab4003a225cbf79d426fcd248e03ff5f499a404d879270086e292aa45ac1af979aa9af4a64e4881ec559fc87e779" -} diff --git a/tests/fixtures/transactions/username_registration/username-registration-sign.json b/tests/fixtures/transactions/username_registration/username-registration-sign.json deleted file mode 100644 index f40a509d..00000000 --- a/tests/fixtures/transactions/username_registration/username-registration-sign.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 8, - "nonce": "4", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "asset": { - "username": "simple_tx_tester" - }, - "signature": "70014805da364407f71ca7e09dae5a685af562b985279e370d1a936ebbe7c2545dca35b0f0f30b72eaee0ca042beb6ef2cab5666dd42831a7d0dacac3d962563", - "id": "a50b909f5b483ef1a9bebff66582de169782d3a8adc3e8fca7b183c39738c721" - }, - "serialized": "ff011e0100000008000400000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f9029500000000001073696d706c655f74785f74657374657270014805da364407f71ca7e09dae5a685af562b985279e370d1a936ebbe7c2545dca35b0f0f30b72eaee0ca042beb6ef2cab5666dd42831a7d0dacac3d962563" -} diff --git a/tests/fixtures/transactions/username_resignation/username-resignation-multi-sign.json b/tests/fixtures/transactions/username_resignation/username-resignation-multi-sign.json deleted file mode 100644 index bc2d7e17..00000000 --- a/tests/fixtures/transactions/username_resignation/username-resignation-multi-sign.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 9, - "nonce": "6", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "signature": "730f5d46f0ee978f5437899cea0912a87d9854f384a94f3b5b88fbdd527573bb6c6ed13b3da0a695e41efe2b14bafd587db4563b8f29e10f78736959250e8414", - "signatures": [ - "00fe3edd3082e95f42177e6f786f22e3df982e1b85446f9291b6effcdbfe311ec7b9d4df7e68a36ddb6afe04564586c9a3c4245d47077bda91c1fda53d294d7317", - "014e0ca11609da9444233dd13a3561c4ac6f779a177389b498749d70076126b1081d6bab0106938b2431c04c8b4cecb78f8d348ba81e7a03eee5f9fc9b0f1a3131", - "023a7826b28719baf87f4a3a5a10b51d2ce26172a01d92d41691edf7630fd5bd51d9ace6fdfa1361c7a0834d6a6017c3fba4f642fcb2a49e251fbcf6464b5256cc" - ], - "id": "d0210c375d32eec25ca9513099b98e559c3acb136d08011874149217e17ff8f1" - }, - "serialized": "ff011e0100000009000600000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f902950000000000730f5d46f0ee978f5437899cea0912a87d9854f384a94f3b5b88fbdd527573bb6c6ed13b3da0a695e41efe2b14bafd587db4563b8f29e10f78736959250e841400fe3edd3082e95f42177e6f786f22e3df982e1b85446f9291b6effcdbfe311ec7b9d4df7e68a36ddb6afe04564586c9a3c4245d47077bda91c1fda53d294d7317014e0ca11609da9444233dd13a3561c4ac6f779a177389b498749d70076126b1081d6bab0106938b2431c04c8b4cecb78f8d348ba81e7a03eee5f9fc9b0f1a3131023a7826b28719baf87f4a3a5a10b51d2ce26172a01d92d41691edf7630fd5bd51d9ace6fdfa1361c7a0834d6a6017c3fba4f642fcb2a49e251fbcf6464b5256cc" -} diff --git a/tests/fixtures/transactions/username_resignation/username-resignation-sign.json b/tests/fixtures/transactions/username_resignation/username-resignation-sign.json deleted file mode 100644 index 9209da01..00000000 --- a/tests/fixtures/transactions/username_resignation/username-resignation-sign.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 9, - "nonce": "4", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "signature": "72b0322b72019f688fc21f367d68b38828c6e3966e52b3fd46f0813cc7c2cdfd58097c4eef8b52896aba1300098e20a38659529b45db9dfca7aa23d560457769", - "id": "1f90e26793dd55b6b2464002dc537882df94199249ba0bd07fcb4512851ed22b" - }, - "serialized": "ff011e0100000009000400000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f90295000000000072b0322b72019f688fc21f367d68b38828c6e3966e52b3fd46f0813cc7c2cdfd58097c4eef8b52896aba1300098e20a38659529b45db9dfca7aa23d560457769" -} diff --git a/tests/fixtures/transactions/validator_registration/validator-registration-multi-sign.json b/tests/fixtures/transactions/validator_registration/validator-registration-multi-sign.json deleted file mode 100644 index 7e7f3fc8..00000000 --- a/tests/fixtures/transactions/validator_registration/validator-registration-multi-sign.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 2, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "asset": { - "validatorPublicKey": "a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d3141118" - }, - "signature": "0604c8ecb42e1cc125da7e88fbb6e8b3c3cb703890701b91f8277bf84493ac4994417e8c090309f8147316091d879a1a3c1ce15a6476e029c6f0597a5cfd3533", - "signatures": [ - "00ad621bb19f24c785eded7e3953b575e25fca5b26890eda8ac87cb029d8a28d2c2ef084d98d617fddf7677b27488705e3c5c6d6568a2c44753212e3589e93b89c", - "018de3507e97d8e8e88f77c2cac0c4a7b8767b8527b2a53d81a119e2dbf6672fc8595de1c9ddbb1c88fadf7266923b2289dfbd3b266059c77609bdec52e8efeb61", - "021cbf94035e39cf80b4ccb7ee7d9cfac747ab6e1f73ef4a68b5600ee48c1e94861076718d11ab3908ecc6252c0ea515f6586f966e50842846cce5eada78d84453" - ], - "id": "91c5b9e9dd0915a0e2a44edcae3cd0182ffcdcc3921721fc4a88e5b91a3a1d90" - }, - "serialized": "ff011e0100000002000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f902950000000000a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d31411180604c8ecb42e1cc125da7e88fbb6e8b3c3cb703890701b91f8277bf84493ac4994417e8c090309f8147316091d879a1a3c1ce15a6476e029c6f0597a5cfd353300ad621bb19f24c785eded7e3953b575e25fca5b26890eda8ac87cb029d8a28d2c2ef084d98d617fddf7677b27488705e3c5c6d6568a2c44753212e3589e93b89c018de3507e97d8e8e88f77c2cac0c4a7b8767b8527b2a53d81a119e2dbf6672fc8595de1c9ddbb1c88fadf7266923b2289dfbd3b266059c77609bdec52e8efeb61021cbf94035e39cf80b4ccb7ee7d9cfac747ab6e1f73ef4a68b5600ee48c1e94861076718d11ab3908ecc6252c0ea515f6586f966e50842846cce5eada78d84453" -} diff --git a/tests/fixtures/transactions/validator_registration/validator-registration-sign.json b/tests/fixtures/transactions/validator_registration/validator-registration-sign.json deleted file mode 100644 index efbd345d..00000000 --- a/tests/fixtures/transactions/validator_registration/validator-registration-sign.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 2, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "asset": { - "validatorPublicKey": "a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d3141118" - }, - "signature": "449a02672bf54a67ecdbeab20d3fbc16a1358397ebbe28398338f97d9823752f0b3e6c715ce6ad47d8f4df95a7a1ef97b76d159513ba680edecf9e3dd4d76719", - "id": "18659c72ed03091989bf960450ab156d04794ea037357c2f4839d362a1ad576a" - }, - "serialized": "ff011e0100000002000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f902950000000000a08058db53e2665c84a40f5152e76dd2b652125a6079130d4c315e728bcf4dd1dfb44ac26e82302331d61977d3141118449a02672bf54a67ecdbeab20d3fbc16a1358397ebbe28398338f97d9823752f0b3e6c715ce6ad47d8f4df95a7a1ef97b76d159513ba680edecf9e3dd4d76719" -} diff --git a/tests/fixtures/transactions/validator_resignation/validator-resignation-multi-sign.json b/tests/fixtures/transactions/validator_resignation/validator-resignation-multi-sign.json deleted file mode 100644 index 9ce2df83..00000000 --- a/tests/fixtures/transactions/validator_resignation/validator-resignation-multi-sign.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 7, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "signature": "a32aeb2cd0695a71f35953e2bac27b36ba51c6fb3f36b98a5e05072500a96206b3afc95efa47d2bbce291b12307c4bd5e79171930e13844a0bc2036516e26644", - "signatures": [ - "00e78bd07e68978b0bcc911c3b4cce17957a347b3ceda0fe78fca3624c6e9d752c46ba75d31004661d097bc6c2471f86fb6727ac9e385c931d2850fc1ad3eb98c0", - "01706c56c0a5568df17342bb0fffec66cbf948425153f31ee3f16760c372ae4e020f2489695c3f3a80524bbba6fa97aef074259e8dc9305966dfc1a40a632872d0", - "021e218f51b7803c327c092f89af015573371506dd8f27a96dacaf29286d8ecc5d955443cfb1a5d93f359ebef67fdb842fc3e9a8d9691e57a5f627cb11425526e0" - ], - "id": "97ff3cf77125fea2ce33f23ef4ce85d56e207bc47e1595c004a319976fdca64c" - }, - "serialized": "ff011e0100000007000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f902950000000000a32aeb2cd0695a71f35953e2bac27b36ba51c6fb3f36b98a5e05072500a96206b3afc95efa47d2bbce291b12307c4bd5e79171930e13844a0bc2036516e2664400e78bd07e68978b0bcc911c3b4cce17957a347b3ceda0fe78fca3624c6e9d752c46ba75d31004661d097bc6c2471f86fb6727ac9e385c931d2850fc1ad3eb98c001706c56c0a5568df17342bb0fffec66cbf948425153f31ee3f16760c372ae4e020f2489695c3f3a80524bbba6fa97aef074259e8dc9305966dfc1a40a632872d0021e218f51b7803c327c092f89af015573371506dd8f27a96dacaf29286d8ecc5d955443cfb1a5d93f359ebef67fdb842fc3e9a8d9691e57a5f627cb11425526e0" -} diff --git a/tests/fixtures/transactions/validator_resignation/validator-resignation-sign.json b/tests/fixtures/transactions/validator_resignation/validator-resignation-sign.json deleted file mode 100644 index 4492199d..00000000 --- a/tests/fixtures/transactions/validator_resignation/validator-resignation-sign.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 7, - "nonce": "0", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "2500000000", - "amount": "0", - "signature": "f9d93dc161b5351a9e6f89e97bd3a4d1b73349c2339145021dee2654f5a8116aa78c6c3742b5fc39d0c9265735b866954d8c6c8383130d08659b1aff3967d4eb", - "id": "431b779764f51e227eca907706bd339de36c3b23bd46c603283f3a932d12b936" - }, - "serialized": "ff011e0100000007000000000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300f902950000000000f9d93dc161b5351a9e6f89e97bd3a4d1b73349c2339145021dee2654f5a8116aa78c6c3742b5fc39d0c9265735b866954d8c6c8383130d08659b1aff3967d4eb" -} diff --git a/tests/fixtures/transactions/vote/vote-multi-sign.json b/tests/fixtures/transactions/vote/vote-multi-sign.json deleted file mode 100644 index 1b9b0a55..00000000 --- a/tests/fixtures/transactions/vote/vote-multi-sign.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 3, - "nonce": "1", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "100000000", - "amount": "0", - "asset": { - "votes": [ - "03f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc" - ] - }, - "signature": "72a097e05983575a69ab7c2c15d80beea988fc02e08124a969b281fa09d1e47ff0b36706f9a9bb6b2e18db929f21b08571c4be36fe2882fecfb990e465bfebde", - "signatures": [ - "0035173f507953f5a7f9da525384b9a1021b553c1089f060e6e77118ab5aa68549ea89d4b63391941e95c0142dd195fd8c032c0a9aca9e1a72943dde8ecd663070", - "010dba0e40f903c7ec76e1f1e7ef3c145e69a878b13e833d132b9f1fa267ba3b2ab049941ede13faee3da9611ac27cb52a6888bbd093a253e7d7bea4c633d4a706", - "02556654e210ed6426d20c0fe246d3270bcdea97d5ab59f5c90888731b079ff83ab53cac3bc80680f093f2e5a78216a0ed894c6985bd89b3802b2d8ff3f6b4c584" - ], - "id": "e344602ba9fe82d035af6c8b759682bab0317ca523212724542217803c093adb" - }, - "serialized": "ff011e0100000003000100000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300e1f50500000000000103f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc0072a097e05983575a69ab7c2c15d80beea988fc02e08124a969b281fa09d1e47ff0b36706f9a9bb6b2e18db929f21b08571c4be36fe2882fecfb990e465bfebde0035173f507953f5a7f9da525384b9a1021b553c1089f060e6e77118ab5aa68549ea89d4b63391941e95c0142dd195fd8c032c0a9aca9e1a72943dde8ecd663070010dba0e40f903c7ec76e1f1e7ef3c145e69a878b13e833d132b9f1fa267ba3b2ab049941ede13faee3da9611ac27cb52a6888bbd093a253e7d7bea4c633d4a70602556654e210ed6426d20c0fe246d3270bcdea97d5ab59f5c90888731b079ff83ab53cac3bc80680f093f2e5a78216a0ed894c6985bd89b3802b2d8ff3f6b4c584" -} diff --git a/tests/fixtures/transactions/vote/vote-sign.json b/tests/fixtures/transactions/vote/vote-sign.json deleted file mode 100644 index 0f2b988a..00000000 --- a/tests/fixtures/transactions/vote/vote-sign.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "data": { - "version": 1, - "network": 30, - "typeGroup": 1, - "type": 3, - "nonce": "1", - "senderPublicKey": "023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d3", - "fee": "100000000", - "amount": "0", - "asset": { - "votes": [ - "03f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc" - ] - }, - "signature": "e0a99c2ebd108c6ba1828f4d11e5ce8cdf2e67152575cabea2e86ab59153a1f1493b768af6dfe0a33eec22edf2dd87c25e1531bf285bb4131e4fcdbfce4c8781", - "id": "81bffacc80ae1c3b3f127cbaf5d2867d3209c38610d2cc5a341702fc252cd330" - }, - "serialized": "ff011e0100000003000100000000000000023efc1da7f315f3c533a4080e491f32cd4219731cef008976c3876539e1f192d300e1f50500000000000103f25455408f9a7e6c6a056b121e68fbda98f3511d22e9ef27b0ebaf1ef9e4eabc00e0a99c2ebd108c6ba1828f4d11e5ce8cdf2e67152575cabea2e86ab59153a1f1493b768af6dfe0a33eec22edf2dd87c25e1531bf285bb4131e4fcdbfce4c8781" -}