Skip to content

Commit

Permalink
feat: don't reimplement thisBytes65()
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Jan 10, 2024
1 parent bb61af1 commit 4eae977
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 45 deletions.
80 changes: 40 additions & 40 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
AckReentryTest:test_reentry_on_ack_message() (gas: 531789)
CallReentryTest:test_reentry_on_call_message() (gas: 560903)
EscrowInformationTest:test_check_escrow_events() (gas: 100336)
EscrowInformationTest:test_check_escrow_state() (gas: 97727)
EscrowInformationTest:test_gas_refund(uint256) (runs: 256, μ: 149013, ~: 153891)
EscrowWrongGasPaymentTest:test_fail_not_enough_gas_sent() (gas: 94273)
EscrowWrongGasPaymentTest:test_place_incentive() (gas: 90175)
GasSpendControlTest:test_fail_relayer_has_to_provide_enough_gas() (gas: 606085)
GasSpendControlTest:test_process_ack_gas() (gas: 602789)
GasSpendControlTest:test_process_delivery_gas() (gas: 361408)
AckReentryTest:test_reentry_on_ack_message() (gas: 531762)
CallReentryTest:test_reentry_on_call_message() (gas: 560876)
EscrowInformationTest:test_check_escrow_events() (gas: 100309)
EscrowInformationTest:test_check_escrow_state() (gas: 97700)
EscrowInformationTest:test_gas_refund(uint256) (runs: 256, μ: 149198, ~: 153864)
EscrowWrongGasPaymentTest:test_fail_not_enough_gas_sent() (gas: 94246)
EscrowWrongGasPaymentTest:test_place_incentive() (gas: 90148)
GasSpendControlTest:test_fail_relayer_has_to_provide_enough_gas() (gas: 606058)
GasSpendControlTest:test_process_ack_gas() (gas: 602762)
GasSpendControlTest:test_process_delivery_gas() (gas: 361381)
IncreaseBountyTest:test_fail_bounty_does_not_exist() (gas: 18055)
IncreaseBountyTest:test_fail_overpay() (gas: 128688)
IncreaseBountyTest:test_fail_under_and_overpay(int256) (runs: 256, μ: 130774, ~: 130774)
IncreaseBountyTest:test_increase_escrow() (gas: 130475)
IncreaseBountyTest:test_no_increase_escrow() (gas: 123204)
MessageIdentifierTest:test_destination_identifier_impacts_message_identifier() (gas: 302699)
MessageIdentifierTest:test_non_unique_bounty(bytes) (runs: 256, μ: 105449, ~: 105343)
MessageIdentifierTest:test_unique_identifier_block_10() (gas: 97491)
MessageIdentifierTest:test_unique_identifier_block_11() (gas: 97447)
IncreaseBountyTest:test_fail_overpay() (gas: 128661)
IncreaseBountyTest:test_fail_under_and_overpay(int256) (runs: 256, μ: 130747, ~: 130747)
IncreaseBountyTest:test_increase_escrow() (gas: 130448)
IncreaseBountyTest:test_no_increase_escrow() (gas: 123177)
MessageIdentifierTest:test_destination_identifier_impacts_message_identifier() (gas: 302645)
MessageIdentifierTest:test_non_unique_bounty(bytes) (runs: 256, μ: 105422, ~: 105316)
MessageIdentifierTest:test_unique_identifier_block_10() (gas: 97464)
MessageIdentifierTest:test_unique_identifier_block_11() (gas: 97420)
NoImplementationAddressSetTest:test_error_no_implementation_address_set() (gas: 344384)
OnRecvAckTest:test_on_ack() (gas: 231324)
OnRecvCallTest:test_on_call() (gas: 163377)
OnRecvRecoverAckTest:test_recover_ack() (gas: 246226)
OnRecvTimeoutTest:test_on_timeout() (gas: 122848)
ReturnBombTest:test_process_ack_gas() (gas: 5339420)
TargetDeltaZeroTest:test_target_delta_zero(uint16) (runs: 256, μ: 257574, ~: 257574)
OnRecvAckTest:test_on_ack() (gas: 231297)
OnRecvCallTest:test_on_call() (gas: 163350)
OnRecvRecoverAckTest:test_recover_ack() (gas: 246199)
OnRecvTimeoutTest:test_on_timeout() (gas: 122827)
ReturnBombTest:test_process_ack_gas() (gas: 5339393)
TargetDeltaZeroTest:test_target_delta_zero(uint16) (runs: 256, μ: 257547, ~: 257547)
TestMessages:testCannotVerifySignaturesWithInvalidSignature(bytes) (runs: 256, μ: 28385, ~: 28377)
TestMessages:testCannotVerifySignaturesWithOutOfBoundsSignature(bytes) (runs: 256, μ: 30004, ~: 29996)
TestMessages:testHashMismatchedVMIsNotVerified() (gas: 92346)
Expand All @@ -34,23 +34,23 @@ TestMessagesC2Sigs:test_compare_wormhole_implementation_and_calldata_version() (
TestMessagesC2Sigs:test_error_invalid_vm() (gas: 135841)
TestMessagesC:test_compare_wormhole_implementation_and_calldata_version() (gas: 105094)
TestMessagesC:test_error_invalid_vm() (gas: 103784)
TestRoundtrip:test_escrow_wormhole_message(bytes) (runs: 256, μ: 265131, ~: 264620)
TestRoundtrip:test_escrow_wormhole_message(bytes) (runs: 256, μ: 265077, ~: 264566)
TestSetRemoteImplementation:test_set_remote_implementation(bytes32,bytes) (runs: 256, μ: 109353, ~: 95762)
TestSetRemoteImplementation:test_set_remote_implementation_twice(bytes32,bytes) (runs: 256, μ: 93609, ~: 83128)
TestprocessPacketDisabled:test_process_message_disabled(bytes,bytes,address) (runs: 256, μ: 10269, ~: 10249)
TimeOverflowTest:test_larger_than_uint_time_is_fine() (gas: 253819)
TimeOverflowTest:test_overflow_in_unchecked_is_fine() (gas: 255989)
processPacketAckTest:test_ack_called_event() (gas: 219449)
processPacketAckTest:test_ack_different_recipitents() (gas: 254122)
processPacketAckTest:test_ack_less_time_than_expected(uint64,uint64) (runs: 256, μ: 256800, ~: 258981)
processPacketAckTest:test_ack_more_time_than_expected(uint64,uint64) (runs: 256, μ: 259777, ~: 259777)
processPacketAckTest:test_ack_process_message() (gas: 214659)
processPacketCallTest:test_call_process_message() (gas: 177934)
processPacketCallTest:test_call_process_message_twice() (gas: 173572)
processPacketCallTest:test_expect_caller(address) (runs: 256, μ: 229431, ~: 229431)
processPacketNoReceiveTest:test_application_does_not_implement_interface() (gas: 174918)
sendPacketPaymentTest:test_error_send_message_without_additional_cost() (gas: 110283)
TimeOverflowTest:test_larger_than_uint_time_is_fine() (gas: 253792)
TimeOverflowTest:test_overflow_in_unchecked_is_fine() (gas: 255962)
processPacketAckTest:test_ack_called_event() (gas: 219422)
processPacketAckTest:test_ack_different_recipitents() (gas: 254095)
processPacketAckTest:test_ack_less_time_than_expected(uint64,uint64) (runs: 256, μ: 257188, ~: 258954)
processPacketAckTest:test_ack_more_time_than_expected(uint64,uint64) (runs: 256, μ: 259750, ~: 259750)
processPacketAckTest:test_ack_process_message() (gas: 214632)
processPacketCallTest:test_call_process_message() (gas: 177907)
processPacketCallTest:test_call_process_message_twice() (gas: 173545)
processPacketCallTest:test_expect_caller(address) (runs: 256, μ: 229404, ~: 229404)
processPacketNoReceiveTest:test_application_does_not_implement_interface() (gas: 174891)
sendPacketPaymentTest:test_error_send_message_without_additional_cost() (gas: 110256)
sendPacketPaymentTest:test_estimate_cost() (gas: 8119)
sendPacketPaymentTest:test_process_message_with_additional_payment(bytes) (runs: 256, μ: 175760, ~: 175545)
sendPacketPaymentTest:test_process_message_without_additional_payment(bytes) (runs: 256, μ: 176320, ~: 176105)
sendPacketPaymentTest:test_send_message_with_additional_cost() (gas: 103008)
sendPacketPaymentTest:test_process_message_with_additional_payment(bytes) (runs: 256, μ: 175733, ~: 175518)
sendPacketPaymentTest:test_process_message_without_additional_payment(bytes) (runs: 256, μ: 176293, ~: 176078)
sendPacketPaymentTest:test_send_message_with_additional_cost() (gas: 102981)
6 changes: 1 addition & 5 deletions src/utils/Bytes65.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ contract Bytes65 {
}

function thisBytes65() public view returns(bytes memory) {
return abi.encodePacked(
uint8(20), // Size of address. Is always 20 for EVM
bytes32(0), // First 32 bytes on EVM are 0
bytes32(uint256(uint160(address(this)))) // Encode the address in bytes32.
);
return convertEVMTo65(address(this));
}
}

0 comments on commit 4eae977

Please sign in to comment.