Skip to content

Commit d211801

Browse files
committed
chain/ethereum: Remove commented-out code from abi.rs
1 parent 449f66a commit d211801

File tree

2 files changed

+0
-188
lines changed

2 files changed

+0
-188
lines changed

chain/ethereum/src/ingestor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ impl PollingBlockIngestor {
169169
eth_adapter: &Arc<EthereumAdapter>,
170170
block_hash: &BlockHash,
171171
) -> Result<Option<BlockHash>, IngestorError> {
172-
// TODO: B256::from_slice can panic
173172
let block_hash = B256::from_slice(block_hash.as_slice());
174173

175174
// Get the fully populated block

chain/ethereum/src/runtime/abi.rs

Lines changed: 0 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,6 @@ impl ToAscObj<AscLogArray> for &[Log] {
117117
}
118118
}
119119

120-
// impl ToAscObj<AscLogArray> for Vec<Log> {
121-
// fn to_asc_obj<H: AscHeap + ?Sized>(
122-
// &self,
123-
// heap: &mut H,
124-
// gas: &GasCounter,
125-
// ) -> Result<AscLogArray, HostExportError> {
126-
// let logs = self
127-
// .iter()
128-
// .map(|log| asc_new(heap, &log, gas))
129-
// .collect::<Result<Vec<_>, _>>()?;
130-
// Ok(AscLogArray(Array::new(&logs, heap, gas)?))
131-
// }
132-
// }
133-
134120
impl AscIndexId for AscLogArray {
135121
const INDEX_ASC_TYPE_ID: IndexForAscTypeId = IndexForAscTypeId::ArrayLog;
136122
}
@@ -598,47 +584,6 @@ where
598584
}
599585
}
600586

601-
impl<'a, T, B> ToAscObj<AscEthereumEvent_0_0_7<T, B>>
602-
for (EthereumEventData<'a>, Option<&TransactionReceipt>)
603-
where
604-
T: AscType + AscIndexId,
605-
B: AscType + AscIndexId,
606-
EthereumTransactionData<'a>: ToAscObj<T>,
607-
EthereumBlockData<'a>: ToAscObj<B>,
608-
{
609-
fn to_asc_obj<H: AscHeap + ?Sized>(
610-
&self,
611-
heap: &mut H,
612-
gas: &GasCounter,
613-
) -> Result<AscEthereumEvent_0_0_7<T, B>, HostExportError> {
614-
let (event_data, optional_receipt) = self;
615-
let AscEthereumEvent {
616-
address,
617-
log_index,
618-
transaction_log_index,
619-
log_type,
620-
block,
621-
transaction,
622-
params,
623-
} = event_data.to_asc_obj(heap, gas)?;
624-
let receipt = if let Some(receipt_data) = optional_receipt {
625-
asc_new(heap, receipt_data, gas)?
626-
} else {
627-
AscPtr::null()
628-
};
629-
Ok(AscEthereumEvent_0_0_7 {
630-
address,
631-
log_index,
632-
transaction_log_index,
633-
log_type,
634-
block,
635-
transaction,
636-
params,
637-
receipt,
638-
})
639-
}
640-
}
641-
642587
impl<'a, T, B, Inner> ToAscObj<AscEthereumEvent_0_0_7<T, B>>
643588
for (
644589
EthereumEventData<'a>,
@@ -685,94 +630,6 @@ where
685630
}
686631
}
687632

688-
// impl<'a, T, B> ToAscObj<AscEthereumEvent_0_0_7<T, B>>
689-
// for (EthereumEventData<'a>, Option<&TransactionReceipt>)
690-
// where
691-
// T: AscType + AscIndexId,
692-
// B: AscType + AscIndexId,
693-
// EthereumTransactionData<'a>: ToAscObj<T>,
694-
// EthereumBlockData<'a>: ToAscObj<B>,
695-
// {
696-
// fn to_asc_obj<H: AscHeap + ?Sized>(
697-
// &self,
698-
// heap: &mut H,
699-
// gas: &GasCounter,
700-
// ) -> Result<AscEthereumEvent_0_0_7<T, B>, HostExportError> {
701-
// let (event_data, optional_receipt) = self;
702-
// let AscEthereumEvent {
703-
// address,
704-
// log_index,
705-
// transaction_log_index,
706-
// log_type,
707-
// block,
708-
// transaction,
709-
// params,
710-
// } = event_data.to_asc_obj(heap, gas)?;
711-
// let receipt = if let Some(receipt_data) = optional_receipt {
712-
// asc_new(heap, receipt_data, gas)?
713-
// } else {
714-
// AscPtr::null()
715-
// };
716-
// Ok(AscEthereumEvent_0_0_7 {
717-
// address,
718-
// log_index,
719-
// transaction_log_index,
720-
// log_type,
721-
// block,
722-
// transaction,
723-
// params,
724-
// receipt,
725-
// })
726-
// }
727-
// }
728-
729-
// impl ToAscObj<AscEthereumLog> for Log {
730-
// fn to_asc_obj<H: AscHeap + ?Sized>(
731-
// &self,
732-
// heap: &mut H,
733-
// gas: &GasCounter,
734-
// ) -> Result<AscEthereumLog, HostExportError> {
735-
// Ok(AscEthereumLog {
736-
// address: asc_new(heap, &self.address, gas)?,
737-
// topics: asc_new(heap, &self.topics, gas)?,
738-
// data: asc_new(heap, self.data.0.as_slice(), gas)?,
739-
// block_hash: self
740-
// .block_hash
741-
// .map(|block_hash| asc_new(heap, &block_hash, gas))
742-
// .unwrap_or(Ok(AscPtr::null()))?,
743-
// block_number: self
744-
// .block_number
745-
// .map(|block_number| asc_new(heap, &BigInt::from(block_number), gas))
746-
// .unwrap_or(Ok(AscPtr::null()))?,
747-
// transaction_hash: self
748-
// .transaction_hash
749-
// .map(|txn_hash| asc_new(heap, &txn_hash, gas))
750-
// .unwrap_or(Ok(AscPtr::null()))?,
751-
// transaction_index: self
752-
// .transaction_index
753-
// .map(|txn_index| asc_new(heap, &BigInt::from(txn_index), gas))
754-
// .unwrap_or(Ok(AscPtr::null()))?,
755-
// log_index: self
756-
// .log_index
757-
// .map(|log_index| asc_new(heap, &BigInt::from_unsigned_u256(&log_index), gas))
758-
// .unwrap_or(Ok(AscPtr::null()))?,
759-
// transaction_log_index: self
760-
// .transaction_log_index
761-
// .map(|index| asc_new(heap, &BigInt::from_unsigned_u256(&index), gas))
762-
// .unwrap_or(Ok(AscPtr::null()))?,
763-
// log_type: self
764-
// .log_type
765-
// .as_ref()
766-
// .map(|log_type| asc_new(heap, &log_type, gas))
767-
// .unwrap_or(Ok(AscPtr::null()))?,
768-
// removed: self
769-
// .removed
770-
// .map(|removed| asc_new(heap, &AscWrapped { inner: removed }, gas))
771-
// .unwrap_or(Ok(AscPtr::null()))?,
772-
// })
773-
// }
774-
// }
775-
776633
impl ToAscObj<AscEthereumLog> for Log {
777634
fn to_asc_obj<H: AscHeap + ?Sized>(
778635
&self,
@@ -904,50 +761,6 @@ impl ToAscObj<AscEthereumTransactionReceipt>
904761
}
905762
}
906763

907-
// impl ToAscObj<AscEthereumTransactionReceipt> for &TransactionReceipt {
908-
// fn to_asc_obj<H: AscHeap + ?Sized>(
909-
// &self,
910-
// heap: &mut H,
911-
// gas: &GasCounter,
912-
// ) -> Result<AscEthereumTransactionReceipt, HostExportError> {
913-
// Ok(AscEthereumTransactionReceipt {
914-
// transaction_hash: asc_new(heap, &self.transaction_hash, gas)?,
915-
// transaction_index: asc_new(heap, &BigInt::from(self.transaction_index), gas)?,
916-
// block_hash: self
917-
// .block_hash
918-
// .map(|block_hash| asc_new(heap, &block_hash, gas))
919-
// .unwrap_or(Ok(AscPtr::null()))?,
920-
// block_number: self
921-
// .block_number
922-
// .map(|block_number| asc_new(heap, &BigInt::from(block_number), gas))
923-
// .unwrap_or(Ok(AscPtr::null()))?,
924-
// cumulative_gas_used: asc_new(
925-
// heap,
926-
// &BigInt::from_unsigned_u256(&self.cumulative_gas_used),
927-
// gas,
928-
// )?,
929-
// gas_used: self
930-
// .gas_used
931-
// .map(|gas_used| asc_new(heap, &BigInt::from_unsigned_u256(&gas_used), gas))
932-
// .unwrap_or(Ok(AscPtr::null()))?,
933-
// contract_address: self
934-
// .contract_address
935-
// .map(|contract_address| asc_new(heap, &contract_address, gas))
936-
// .unwrap_or(Ok(AscPtr::null()))?,
937-
// logs: asc_new(heap, &self.logs, gas)?,
938-
// status: self
939-
// .status
940-
// .map(|status| asc_new(heap, &BigInt::from(status), gas))
941-
// .unwrap_or(Ok(AscPtr::null()))?,
942-
// root: self
943-
// .root
944-
// .map(|root| asc_new(heap, &root, gas))
945-
// .unwrap_or(Ok(AscPtr::null()))?,
946-
// logs_bloom: asc_new(heap, self.logs_bloom.as_bytes(), gas)?,
947-
// })
948-
// }
949-
// }
950-
951764
impl<'a> ToAscObj<AscEthereumCall> for EthereumCallData<'a> {
952765
fn to_asc_obj<H: AscHeap + ?Sized>(
953766
&self,

0 commit comments

Comments
 (0)