Skip to content

Commit 1e43457

Browse files
committed
Test-related fixes
1 parent 6e551c0 commit 1e43457

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

app/models/ethscription_transaction_builder.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def process_create_events
8080
)
8181

8282
@transactions << transaction if transaction.valid_create?
83-
rescue Eth::Abi::DecodingError => e
83+
rescue Eth::Abi::DecodingError, RangeError => e
8484
Rails.logger.error "Failed to decode create event: #{e.message}"
8585
next
8686
end
@@ -131,7 +131,7 @@ def process_event_transfers
131131
when ESIP2_SIG
132132
handle_esip2_event(log) if SysConfig.esip2_enabled?(@eth_tx.block_number)
133133
end
134-
rescue Eth::Abi::DecodingError => e
134+
rescue Eth::Abi::DecodingError, RangeError => e
135135
Rails.logger.error "Failed to decode transfer event: #{e.message}"
136136
next
137137
end

contracts/script/L2Genesis.s.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ contract L2Genesis is Script {
264264
uint256 index,
265265
GenesisEthscriptions genesisContract
266266
) internal {
267+
if (!vm.envOr("PERFORM_GENESIS_IMPORT", true)) {
268+
return;
269+
}
270+
267271
string memory basePath = string.concat(".ethscriptions[", vm.toString(index), "]");
268272

269273
// Parse all data needed

contracts/src/Ethscriptions.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ contract Ethscriptions is ERC721EthscriptionsUpgradeable {
423423
function ownerOf(bytes32 transactionHash) external view requireExists(transactionHash) returns (address) {
424424
Ethscription storage etsc = ethscriptions[transactionHash];
425425
uint256 tokenId = etsc.ethscriptionNumber;
426-
// This will revert if the token is burned (has no owner)
426+
427427
return ownerOf(tokenId);
428428
}
429429

lib/genesis_generator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ def run_forge_genesis_script!
8686
raise "L2Genesis script not found at #{script_path}"
8787
end
8888

89+
should_perform_genesis_import = ENV.fetch('PERFORM_GENESIS_IMPORT', 'true') == 'true'
90+
8991
# Build the forge script command
90-
cmd = "cd #{contracts_dir} && forge script '#{script_path}:L2Genesis'"
92+
cmd = "cd #{contracts_dir} && PERFORM_GENESIS_IMPORT=#{should_perform_genesis_import} forge script '#{script_path}:L2Genesis'"
9193

9294
puts "Executing: #{cmd}"
9395
puts

0 commit comments

Comments
 (0)