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

[RFC] Add native function create_uuid #8401

Merged
merged 71 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2cd733c
Add native function create_guid
vusirikala May 26, 2023
3decce0
Append a constant to hash_arg
vusirikala May 27, 2023
c9b68ec
Add move test to verify uniqueness of guids
vusirikala May 27, 2023
4c4ef51
Charging gas for create_guid method
vusirikala May 27, 2023
fc9b372
Merge branch 'main' into satya/create-guid
vusirikala May 27, 2023
2284e55
Add gas for create guid
vusirikala May 27, 2023
2f0d2eb
Add create_guid to object.move
vusirikala May 28, 2023
80b7cbb
Change GUID to UUID
vusirikala May 31, 2023
4d7c564
Change GUID to UUID in tests
vusirikala May 31, 2023
b79d4bc
Change GUID to UUID in tests
vusirikala May 31, 2023
631d66d
Add create_object method in object.move
vusirikala May 31, 2023
bdfaa55
Fix typo
vusirikala May 31, 2023
90f30db
Fix typo
vusirikala May 31, 2023
98ad018
Merge branch 'main' into satya/create-guid
vusirikala May 31, 2023
0a00af6
fix trigger condition for build jobs
geekflyer Jun 4, 2023
f02858f
Add native_get_txn_hash
vusirikala Jun 5, 2023
b632592
Add native_get_txn_hash
vusirikala Jun 5, 2023
1c444d4
Merge branch 'main' into satya/create-guid
vusirikala Jun 5, 2023
3a616ba
Deprecate the old create_object_from_object and create_object_from_ac…
vusirikala Jun 5, 2023
f89370c
Bumped the latest_gas_version to 10
vusirikala Jun 5, 2023
83c4a21
Bumped gas version to 10
vusirikala Jun 5, 2023
8a6ff98
Changed gas feature version to 9
vusirikala Jun 7, 2023
bf29748
Moved transaction hash hashing to authenticator.rs
vusirikala Jun 7, 2023
ee02708
Add documentation to create_uuid method
vusirikala Jun 8, 2023
638e2af
Use AuthenticationKey struct for create_uuid
vusirikala Jun 8, 2023
331e728
Remove deprecated comment
vusirikala Jun 8, 2023
ce78b04
Updatd comments in object.move
vusirikala Jun 8, 2023
575e409
Changed create_uuid to use only one hash
vusirikala Jun 9, 2023
0e7206d
Merge branch 'main' into satya/create-guid
vusirikala Jun 11, 2023
16b52a4
Add create_unique_address function
vusirikala Jun 11, 2023
f1afb1e
Add drop, store capabilities to UUID
vusirikala Jun 11, 2023
29e0b62
Merge branch 'main' into satya/create-guid
vusirikala Jun 21, 2023
5308088
Resetting the create_object_from_account function
vusirikala Jun 21, 2023
9b1591b
Add comment for create_object function
vusirikala Jun 21, 2023
0424d8b
feature gating
vusirikala Jun 21, 2023
ad6f336
deprecated tag
vusirikala Jun 22, 2023
ea7fbb6
Add transaction context spec
vusirikala Jun 22, 2023
c267a23
Add a test case in transaction_context
vusirikala Jun 22, 2023
7568b15
Updated move test case
vusirikala Jun 22, 2023
f180aa0
Merge branch 'main' into satya/create-guid
vusirikala Jun 22, 2023
23f8776
Add create_token method
vusirikala Jun 22, 2023
fb9bce1
Update test cases
vusirikala Jun 22, 2023
82fec8a
rust lint
vusirikala Jun 22, 2023
41cb9af
Changed comments
vusirikala Jun 23, 2023
4df1c1c
Remove create_token method
vusirikala Jun 23, 2023
752caae
Add feature flag for test
vusirikala Jun 23, 2023
8cdf218
fix a unit test
vusirikala Jun 23, 2023
545283d
Fix unit test
vusirikala Jun 23, 2023
2cadd2c
moved unit test to object.move
vusirikala Jun 23, 2023
aad09cc
changing uuid to auid
vusirikala Jun 24, 2023
2b40d44
Merge branch 'main' into satya/create-guid
vusirikala Jun 24, 2023
06aa5b9
rust lint
vusirikala Jun 24, 2023
584cca2
Minor changes
vusirikala Jun 25, 2023
16252d8
Change uuid to auid in tests
vusirikala Jun 25, 2023
77b2002
Change uuid to auid in tests
vusirikala Jun 25, 2023
8fc34f6
changed name to generate_unique_address
vusirikala Jun 25, 2023
6cdd260
Merge branch 'main' into satya/create-guid
vusirikala Jun 25, 2023
53e4d3d
Fixed the specs which timeout
junkil-park Jun 26, 2023
c3f1a1a
Fixed a unit test
vusirikala Jun 26, 2023
6d7b0dd
Shift test from e2e-move-tests to transaction_context.move
vusirikala Jun 26, 2023
987f88f
Add a comment in object.move
vusirikala Jun 26, 2023
29725d6
rust lint
vusirikala Jun 26, 2023
b86849f
Merge branch 'main' into satya/create-guid
vusirikala Jun 26, 2023
18b4e3b
Add create_token method in token.move (#8825)
vusirikala Jun 26, 2023
e863b87
Enable auid flag in an ambassador.move unit test
vusirikala Jun 26, 2023
b5aecf0
Changed gas cost
vusirikala Jun 26, 2023
e2e05cf
changed name from generate_unique_address to generate_auid_address
vusirikala Jun 26, 2023
1e71ba9
Merge branch 'main' into satya/create-guid
vusirikala Jun 26, 2023
03b9fea
Updated a comment
vusirikala Jun 26, 2023
b54fa0c
Feature gate get_txn_hash
vusirikala Jun 26, 2023
3f0d40d
changing names in test cases
vusirikala Jun 26, 2023
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
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions aptos-move/aptos-gas/src/aptos_framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ crate::natives::define_gas_parameters_for_natives!(GasParameters, "aptos_framewo
[.util.from_bytes.base, "util.from_bytes.base", 300 * MUL],
[.util.from_bytes.per_byte, "util.from_bytes.per_byte", 5 * MUL],

[.transaction_context.get_txn_hash.base, { 9.. => "transaction_context.get_txn_hash.base" }, 200 * MUL],
vusirikala marked this conversation as resolved.
Show resolved Hide resolved
[.transaction_context.get_script_hash.base, "transaction_context.get_script_hash.base", 200 * MUL],
// Using SHA2-256's cost
[.transaction_context.create_uuid.base, { 9.. => "transaction_context.create_uuid.base" }, 3000 * MUL],

[.code.request_publish.base, "code.request_publish.base", 500 * MUL],
[.code.request_publish.per_byte, "code.request_publish.per_byte", 2 * MUL],
Expand Down
4 changes: 3 additions & 1 deletion aptos-move/aptos-gas/src/gas_meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ use move_vm_types::{
use std::collections::BTreeMap;

// Change log:
// - V9
// - Added create_uuid and get_txn_hash native functions
// - V8
// - Added BLS12-381 operations.
// - V7
Expand All @@ -59,7 +61,7 @@ use std::collections::BTreeMap;
// global operations.
// - V1
// - TBA
pub const LATEST_GAS_FEATURE_VERSION: u64 = 8;
pub const LATEST_GAS_FEATURE_VERSION: u64 = 9;

pub(crate) const EXECUTION_GAS_MULTIPLIER: u64 = 20;

Expand Down
6 changes: 5 additions & 1 deletion aptos-move/aptos-vm/src/move_vm_ext/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ impl MoveVmExt {
_ => vec![],
};

extensions.add(NativeTransactionContext::new(script_hash, self.chain_id));
extensions.add(NativeTransactionContext::new(
txn_hash.to_vec(),
script_hash,
self.chain_id,
));
extensions.add(NativeCodeContext::default());
extensions.add(NativeStateStorageContext::new(remote));

Expand Down
6 changes: 5 additions & 1 deletion aptos-move/aptos-vm/src/natives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ pub fn configure_for_unit_test() {
#[cfg(feature = "testing")]
fn unit_test_extensions_hook(exts: &mut NativeContextExtensions) {
exts.add(NativeCodeContext::default());
exts.add(NativeTransactionContext::new(vec![1], ChainId::test().id())); // We use the testing environment chain ID here
exts.add(NativeTransactionContext::new(
vec![1],
vec![1],
ChainId::test().id(),
)); // We use the testing environment chain ID here
exts.add(NativeAggregatorContext::new(
[0; 32],
&*DUMMY_RESOLVER,
Expand Down
1 change: 1 addition & 0 deletions aptos-move/e2e-move-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pub mod aggregator;
pub mod harness;
pub mod stake;
pub mod transaction_context;
pub mod transaction_fee;

use anyhow::bail;
Expand Down
1 change: 1 addition & 0 deletions aptos-move/e2e-move-tests/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mod state_metadata;
mod string_args;
mod token_event_store;
mod token_objects;
mod transaction_context;
mod transaction_fee;
mod type_too_large;
mod vector_numeric_address;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "transaction_context_test"
version = "0.0.0"

[dependencies]
AptosFramework = { local = "../../../../framework/aptos-framework" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module 0x1::transaction_context_test {
use std::vector;
use aptos_framework::transaction_context::create_uuid;

/// When checking the value of aggregator fails.
const ENOT_UNIQUE: u64 = 20;

public entry fun create_many_uuids(_account: &signer, count: u64) {
let uuids: vector<address> = vector<address>[];
let i: u64 = 0;
while (i < count) {
i = i+1;
vector::push_back(&mut uuids, create_uuid());
};
i = 0;
while (i < count - 1) {
let j: u64 = i + 1;
while (j < count) {
assert!(*vector::borrow(&uuids, i) != *vector::borrow(&uuids, j), ENOT_UNIQUE);
j = j + 1;
};
i = i + 1;
};
}
}
20 changes: 20 additions & 0 deletions aptos-move/e2e-move-tests/src/tests/transaction_context.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use crate::{
assert_success,
tests::common,
transaction_context::{create_many_uuids, initialize},
MoveHarness,
};
use aptos_language_e2e_tests::account::Account;

fn setup() -> (MoveHarness, Account) {
initialize(common::test_dir_path("transaction_context.data"))
}

#[test]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test where an object is created and check that you can fetch resources there?

Copy link
Contributor Author

@vusirikala vusirikala Jun 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still working on it. Not entirely sure how to interact with objects. Do you have any references to sample code somewhere on how to interact with objects?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the same /resources API to fetch resources at an object address. As for how to get the object address, this would be a good exercise for you to understand how people would be able to get the created addresses from the newly introduced functions.

fn test_many_unique_uuids() {
let (mut h, acc) = setup();

let txn1 = create_many_uuids(&mut h, &acc, 50);

assert_success!(h.run(txn1));
}
27 changes: 27 additions & 0 deletions aptos-move/e2e-move-tests/src/transaction_context.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

use crate::{assert_success, harness::MoveHarness};
use aptos_language_e2e_tests::account::Account;
use aptos_types::{account_address::AccountAddress, transaction::SignedTransaction};
use std::path::PathBuf;

pub fn initialize(path: PathBuf) -> (MoveHarness, Account) {
let mut harness = MoveHarness::new();
let account = harness.new_account_at(AccountAddress::ONE);
assert_success!(harness.publish_package(&account, &path));
(harness, account)
}

pub fn create_many_uuids(
harness: &mut MoveHarness,
account: &Account,
count: u64,
) -> SignedTransaction {
harness.create_entry_function(
account,
str::parse("0x1::transaction_context_test::create_many_uuids").unwrap(),
vec![],
vec![bcs::to_bytes(&count).unwrap()],
)
}
52 changes: 25 additions & 27 deletions aptos-move/framework/aptos-framework/doc/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ make it so that a reference to a global object can be returned from a function.
- [Function `convert`](#0x1_object_convert)
- [Function `create_named_object`](#0x1_object_create_named_object)
- [Function `create_user_derived_object`](#0x1_object_create_user_derived_object)
- [Function `create_object`](#0x1_object_create_object)
- [Function `create_object_from_account`](#0x1_object_create_object_from_account)
- [Function `create_object_from_object`](#0x1_object_create_object_from_object)
- [Function `create_object_from_guid`](#0x1_object_create_object_from_guid)
- [Function `create_object_internal`](#0x1_object_create_object_internal)
- [Function `generate_delete_ref`](#0x1_object_generate_delete_ref)
- [Function `generate_extend_ref`](#0x1_object_generate_extend_ref)
Expand Down Expand Up @@ -78,15 +78,15 @@ make it so that a reference to a global object can be returned from a function.
- [Function `exists_at`](#@Specification_1_exists_at)


<pre><code><b>use</b> <a href="account.md#0x1_account">0x1::account</a>;
<b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs">0x1::bcs</a>;
<pre><code><b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs">0x1::bcs</a>;
<b>use</b> <a href="create_signer.md#0x1_create_signer">0x1::create_signer</a>;
<b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error">0x1::error</a>;
<b>use</b> <a href="event.md#0x1_event">0x1::event</a>;
<b>use</b> <a href="../../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs">0x1::from_bcs</a>;
<b>use</b> <a href="guid.md#0x1_guid">0x1::guid</a>;
<b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/hash.md#0x1_hash">0x1::hash</a>;
<b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">0x1::signer</a>;
<b>use</b> <a href="transaction_context.md#0x1_transaction_context">0x1::transaction_context</a>;
<b>use</b> <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">0x1::vector</a>;
</code></pre>

Expand Down Expand Up @@ -225,8 +225,7 @@ This is a one time ability given to the creator to configure the object as neces
<code>can_delete: bool</code>
</dt>
<dd>
Set to true so long as deleting the object is possible. For example, the object was
created via create_object_from_guid.
Set to true so long as deleting the object is possible.
</dd>
</dl>

Expand Down Expand Up @@ -828,14 +827,16 @@ Derivde objects, similar to named objects, cannot be deleted.

</details>

<a name="0x1_object_create_object_from_account"></a>
<a name="0x1_object_create_object"></a>

## Function `create_object_from_account`
## Function `create_object`

Create a new object from a GUID generated by an account.
Create a new object by generating a random UUID based on transaction hash.
The created object is deletable as we can guarantee the same UUID can
never be regenerated with future txs.


<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_account">create_object_from_account</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object">create_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
</code></pre>


Expand All @@ -844,24 +845,24 @@ Create a new object from a GUID generated by an account.
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_account">create_object_from_account</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> {
<b>let</b> <a href="guid.md#0x1_guid">guid</a> = <a href="account.md#0x1_account_create_guid">account::create_guid</a>(creator);
<a href="object.md#0x1_object_create_object_from_guid">create_object_from_guid</a>(<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of">signer::address_of</a>(creator), <a href="guid.md#0x1_guid">guid</a>)
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object">create_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> {
<b>let</b> uuid = aptos_framework::transaction_context::create_uuid();
<a href="object.md#0x1_object_create_object_internal">create_object_internal</a>(<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of">signer::address_of</a>(creator), uuid, <b>true</b>)
}
</code></pre>



</details>

<a name="0x1_object_create_object_from_object"></a>
<a name="0x1_object_create_object_from_account"></a>

## Function `create_object_from_object`
## Function `create_object_from_account`

Create a new object from a GUID generated by an object.
Create a new object by generating a random UUID based on transaction hash.


<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_object">create_object_from_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_account">create_object_from_account</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
</code></pre>


Expand All @@ -870,23 +871,23 @@ Create a new object from a GUID generated by an object.
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_object">create_object_from_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> <b>acquires</b> <a href="object.md#0x1_object_ObjectCore">ObjectCore</a> {
<b>let</b> <a href="guid.md#0x1_guid">guid</a> = <a href="object.md#0x1_object_create_guid">create_guid</a>(creator);
<a href="object.md#0x1_object_create_object_from_guid">create_object_from_guid</a>(<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of">signer::address_of</a>(creator), <a href="guid.md#0x1_guid">guid</a>)
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_account">create_object_from_account</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> {
<a href="object.md#0x1_object_create_object">create_object</a>(creator)
}
</code></pre>



</details>

<a name="0x1_object_create_object_from_guid"></a>
<a name="0x1_object_create_object_from_object"></a>

## Function `create_object_from_guid`
## Function `create_object_from_object`

Create a new object by generating a random UUID based on transaction hash.


<pre><code><b>fun</b> <a href="object.md#0x1_object_create_object_from_guid">create_object_from_guid</a>(creator_address: <b>address</b>, <a href="guid.md#0x1_guid">guid</a>: <a href="guid.md#0x1_guid_GUID">guid::GUID</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_object">create_object_from_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">object::ConstructorRef</a>
</code></pre>


Expand All @@ -895,11 +896,8 @@ Create a new object from a GUID generated by an object.
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="object.md#0x1_object_create_object_from_guid">create_object_from_guid</a>(creator_address: <b>address</b>, <a href="guid.md#0x1_guid">guid</a>: <a href="guid.md#0x1_guid_GUID">guid::GUID</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> {
<b>let</b> bytes = <a href="../../aptos-stdlib/../move-stdlib/doc/bcs.md#0x1_bcs_to_bytes">bcs::to_bytes</a>(&<a href="guid.md#0x1_guid">guid</a>);
<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_push_back">vector::push_back</a>(&<b>mut</b> bytes, <a href="object.md#0x1_object_OBJECT_FROM_GUID_ADDRESS_SCHEME">OBJECT_FROM_GUID_ADDRESS_SCHEME</a>);
<b>let</b> obj_addr = <a href="../../aptos-stdlib/doc/from_bcs.md#0x1_from_bcs_to_address">from_bcs::to_address</a>(<a href="../../aptos-stdlib/../move-stdlib/doc/hash.md#0x1_hash_sha3_256">hash::sha3_256</a>(bytes));
<a href="object.md#0x1_object_create_object_internal">create_object_internal</a>(creator_address, obj_addr, <b>true</b>)
<pre><code><b>public</b> <b>fun</b> <a href="object.md#0x1_object_create_object_from_object">create_object_from_object</a>(creator: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>): <a href="object.md#0x1_object_ConstructorRef">ConstructorRef</a> {
<a href="object.md#0x1_object_create_object">create_object</a>(creator)
}
</code></pre>

Expand Down
52 changes: 52 additions & 0 deletions aptos-move/framework/aptos-framework/doc/transaction_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@



- [Function `get_txn_hash`](#0x1_transaction_context_get_txn_hash)
- [Function `create_uuid`](#0x1_transaction_context_create_uuid)
- [Function `get_script_hash`](#0x1_transaction_context_get_script_hash)
- [Specification](#@Specification_0)
- [Function `get_script_hash`](#@Specification_0_get_script_hash)
Expand All @@ -14,6 +16,56 @@



<a name="0x1_transaction_context_get_txn_hash"></a>

## Function `get_txn_hash`

Return the transaction hash of the current transaction


<pre><code><b>public</b> <b>fun</b> <a href="transaction_context.md#0x1_transaction_context_get_txn_hash">get_txn_hash</a>(): <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>native</b> <b>fun</b> <a href="transaction_context.md#0x1_transaction_context_get_txn_hash">get_txn_hash</a>(): <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;;
</code></pre>



</details>

<a name="0x1_transaction_context_create_uuid"></a>

## Function `create_uuid`

Return a universally unique identifier generated by hashing
the transaction hash of this transaction and a sequence number
specific to this transaction. This function can be called any
number of times inside a single transaction. Each such call increments
the sequence number and generates a new UUID


<pre><code><b>public</b> <b>fun</b> <a href="transaction_context.md#0x1_transaction_context_create_uuid">create_uuid</a>(): <b>address</b>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>native</b> <b>fun</b> <a href="transaction_context.md#0x1_transaction_context_create_uuid">create_uuid</a>(): <b>address</b>;
</code></pre>



</details>

<a name="0x1_transaction_context_get_script_hash"></a>

## Function `get_script_hash`
Expand Down
Loading