-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gathering of transfers in the node + prep work for ABIs (#4646)
* Add 2 RPC endpoint with fake data * Add stream grpc * Add initial impl of execution traces for abi calls * Link job on getting info with API. * Add draft gather infos * Cleanup execution trace * Cargo clippy pass * Update grpc public & stream api for execution traces * Execution trace parameters & return value are now ser in json format * Cargo clippy pass * Fix execution trace unit tests * Add serde_json as an optional dep * Update proto files * Fix finality filter and add placeholder for slot transfers endpoints * Format and add a start of logic for compiling results * Fix compil errors for basic feature * Fix clippy issues * Add JSON-RPC structure endpoint * Flatten code for new abi get_slot_transfers * Fix tu * Fix logic in the stream and add it in the gRPC endpoint and Json-RPC * Format and update massa-runtime * Revert config change on the client * Revert changes on initial rolls file * Fix final broadcast by default on API. * Fix initial rolls * Add transfer when calling an SC --------- Co-authored-by: sydhds <[email protected]>
- Loading branch information
1 parent
f88b1c6
commit b75577f
Showing
40 changed files
with
1,602 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
// Copyright (c) 2022 MASSA LABS <[email protected]> | ||
|
||
use massa_final_state::StateChanges; | ||
use massa_models::{address::Address, amount::Amount, output_event::SCOutputEvent, slot::Slot}; | ||
use massa_models::{ | ||
address::Address, amount::Amount, operation::OperationId, output_event::SCOutputEvent, | ||
slot::Slot, | ||
}; | ||
use serde::{Deserialize, Serialize}; | ||
use std::{collections::VecDeque, fmt::Display}; | ||
|
||
|
@@ -85,3 +88,28 @@ pub struct ReadOnlyCall { | |
/// fee | ||
pub fee: Option<Amount>, | ||
} | ||
|
||
/// Context of the transfer | ||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum TransferContext { | ||
#[serde(rename = "operation_id")] | ||
/// Transfer made in an operation | ||
Operation(OperationId), | ||
#[serde(rename = "asc_index")] | ||
/// Transfer made in an asynchronous call | ||
ASC(u64), | ||
} | ||
|
||
/// Structure defining a transfer | ||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct Transfer { | ||
/// The sender of the transfer | ||
pub from: Address, | ||
/// The receiver of the transfer | ||
pub to: Address, | ||
/// The amount of the transfer | ||
pub amount: Amount, | ||
/// Context | ||
pub context: TransferContext, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.