Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validator txn api fix #13718

Merged
merged 9 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 26 additions & 11 deletions api/types/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

use crate::{
transaction::{
BlockEpilogueTransaction, DecodedTableData, DeleteModule, DeleteResource, DeleteTableItem,
DeletedTableData, MultisigPayload, MultisigTransactionPayload, StateCheckpointTransaction,
UserTransactionRequestInner, WriteModule, WriteResource, WriteTableItem,
BlockEpilogueTransaction, BlockMetadataExtTransaction, DecodedTableData, DeleteModule,
DeleteResource, DeleteTableItem, DeletedTableData, MultisigPayload,
MultisigTransactionPayload, StateCheckpointTransaction, UserTransactionRequestInner,
ValidatorTransaction, WriteModule, WriteResource, WriteTableItem,
},
view::{ViewFunction, ViewRequest},
Address, Bytecode, DirectWriteSet, EntryFunctionId, EntryFunctionPayload, Event,
HexEncodedBytes, MoveFunction, MoveModuleBytecode, MoveResource, MoveScriptBytecode, MoveType,
MoveValue, PendingTransaction, ResourceGroup, ScriptPayload, ScriptWriteSet,
SubmitTransactionRequest, Transaction, TransactionInfo, TransactionOnChainData,
Address, BlockMetadataTransaction, Bytecode, DirectWriteSet, EntryFunctionId,
EntryFunctionPayload, Event, HexEncodedBytes, MoveFunction, MoveModuleBytecode, MoveResource,
MoveScriptBytecode, MoveType, MoveValue, PendingTransaction, ResourceGroup, ScriptPayload,
ScriptWriteSet, SubmitTransactionRequest, Transaction, TransactionInfo, TransactionOnChainData,
TransactionPayload, UserTransactionRequest, VersionedEvent, WriteSet, WriteSetChange,
WriteSetPayload,
};
Expand Down Expand Up @@ -176,7 +177,10 @@ impl<'a, S: StateView> MoveConverter<'a, S> {
timestamp: u64,
data: TransactionOnChainData,
) -> Result<Transaction> {
use aptos_types::transaction::Transaction::*;
use aptos_types::transaction::Transaction::{
BlockEpilogue, BlockMetadata, BlockMetadataExt, GenesisTransaction, StateCheckpoint,
UserTransaction,
};
let aux_data = self
.db
.get_transaction_auxiliary_data_by_version(data.version)?;
Expand All @@ -197,8 +201,15 @@ impl<'a, S: StateView> MoveConverter<'a, S> {
let payload = self.try_into_write_set_payload(write_set)?;
(info, payload, events).into()
},
BlockMetadata(txn) => (&txn, info, events).into(),
BlockMetadataExt(txn) => (&txn, info, events).into(),
BlockMetadata(txn) => {
Transaction::BlockMetadataTransaction(BlockMetadataTransaction::from_internal_repr(
txn, info, events,
))
// (&txn, info, events).into()
},
BlockMetadataExt(txn) => Transaction::BlockMetadataExtTransaction(
BlockMetadataExtTransaction::from_internal_repr(txn, info, events),
),
StateCheckpoint(_) => {
Transaction::StateCheckpointTransaction(StateCheckpointTransaction {
info,
Expand Down Expand Up @@ -228,7 +239,11 @@ impl<'a, S: StateView> MoveConverter<'a, S> {
},
})
},
ValidatorTransaction(_txn) => (info, events, timestamp).into(),
aptos_types::transaction::Transaction::ValidatorTransaction(txn) => {
Transaction::ValidatorTransaction(ValidatorTransaction::from_internal_repr(
zjma marked this conversation as resolved.
Show resolved Hide resolved
txn, info, events, timestamp,
))
},
})
}

Expand Down
Loading
Loading