-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
157 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use core::convert::TryFrom; | ||
|
||
//TODO: either leave it as is when moving to move-vm-backend (then remove this comment) or | ||
// change it to crate error type | ||
use anyhow::Error; | ||
use frame_support::dispatch::Vec; | ||
use move_core_types::language_storage::TypeTag; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
/// Transaction representation used in execute call. | ||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct Transaction { | ||
/// Script bytecode. | ||
pub script_bc: Vec<u8>, | ||
/// Script args. | ||
pub args: Vec<Vec<u8>>, | ||
/// Script type arguments. | ||
pub type_args: Vec<TypeTag>, | ||
} | ||
|
||
impl TryFrom<&[u8]> for Transaction { | ||
type Error = Error; | ||
fn try_from(blob: &[u8]) -> Result<Self, Self::Error> { | ||
bcs::from_bytes(blob).map_err(Error::msg) | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
script { | ||
fun generic_1<T: copy + drop>(x: T) { | ||
let _y = x; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
script { | ||
fun empty_loop() { | ||
let iterations: u64 = 10; | ||
|
||
while (iterations > 0) { | ||
iterations = iterations - 1; | ||
} | ||
} | ||
} | ||
|
||
script { | ||
fun empty_loop_param(iterations: u64) { | ||
while (iterations > 0) { | ||
iterations = iterations - 1; | ||
} | ||
} | ||
} |
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