Skip to content

Commit

Permalink
[types] strip currency code from txn
Browse files Browse the repository at this point in the history
  • Loading branch information
davidiw committed Apr 25, 2022
1 parent 72e5018 commit 17de4fb
Show file tree
Hide file tree
Showing 55 changed files with 178 additions and 623 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0x2eefdb1220b8b58b7a70f789c604ea5b95b48a60da2bd2606a0f966c85c703ad",
"hash": "0x18073cb2536317833aa630d30062383a1f00221dd3604bbce19cd262813e6c36",
"state_root_hash": "0x91e2eee78bb77f42d99d26d17f4bd3e3499fdd18056133ffb8c3ce84e67c6ba7",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "92",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0x22ea81c046b56491a3fd6bd8636483d36e04395a83c262d6389ea98c3cfe859c",
"accumulator_root_hash": "0x763e72d2dccec606cdd70638c442da747a640b0d083d6195d4e9396e57f3c811",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -177,7 +177,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -190,7 +189,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0xbf496107afc5d31cf1b4f1dc79ddc745851e0ceb91cd9c77e938a5896c696e9674d0643ff41a74cb430a376e17878931f020d13c4590a815e58ce89c5431d209"
"signature": "0xb66feafc1e1b95ce33a8e25101a212cdfd4e94a7dfd85409ad538ce7fcc150b610326a97e688b1d02bb4703880631498588784c8128824671b219d6aca6edb04"
},
"events": [],
"timestamp": "1"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0xcb799b84973fe9a6646599d7f35a797145cf6147fdbd374b680d86e95bc6be52",
"hash": "0xf1d9819d9c3890f1d3e515be30cf920bd5bba8a7616dc02f21438c3ce08e27fa",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x535bf329761d97d91814c3aeed51d3a2e6ccfaa19180c76a438aa6a61d2ac9ac",
"accumulator_root_hash": "0x6c82808cd4c32e42de0c9808942ac9e183ce03d58f66a4b327c1c8c61a964a8e",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "module_bundle_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x0b1b9a7c0277b837634135f65c62b2be96ed29e63073f227e6d14e67d6b9e17864b6fa227540d7b47034e06af492e8e35ce3146c4030670b74434b150e860106"
"signature": "0xf6523e24249fbe46e68a0035f7c7daac2cf6c3653ac0192f9f85101116c92fa901238088b8ecaf459c5afbca229cffde00b214626c5be6cb70ce6120d655a80f"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0xba9f68d656259750fdd87d6448bfff411daa120eaa47c8209020d5697598e04d",
"hash": "0x97053ab47cdf9d0bee6a38b61d4ca5366090474be9191c589377dad77b3fab66",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x01a2bd959b75b61577d76b6de7de0945c800f3becf92a36490a10262cb54eaaa",
"accumulator_root_hash": "0x64c72731bbd5de936256dc3835ad2b7435a469b6c9107db7656c3cb470f7b4cc",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x85a13ad035b44e0925d0d9768c8ddf9402c181f16d20f896bb1e65c2a879eacd2516bd184353529ba50e4952eb4accf9d072d05b3834f533314a34b786163f01"
"signature": "0xcff4e485f98cf52f88f493cde50370192e26834236d04e5692dc51b019110c84f1bce5981114fdcbc24ccec86f407ec87ffd332a76c8e4e7fa2ea3b97f6b760e"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0x76c29783900a695057e9a7fa2973a0f555432d36e9aab9dec3cd31ec166e68b3",
"hash": "0x0760cc0dfba7e747fdcfda4ffeffbe4fa42061482758e14803535f5babfb09a0",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xc9d3f973bd207e54a030fe1f1d2768b234e80855f886ac62810bee0d884f7e4d",
"accumulator_root_hash": "0x207f8bc94200a267487ca85b93ccba6994d7e97219b1e0de61354cff6c155010",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x7ba954d382f751df0c3da4fd507feadf0ee6b995eca588e39a94bdac37db32422f183f29962380dca2b3f3ebfdb43841594499eb7b9196aac73a7266d9d1fc0e"
"signature": "0x1a49176730d446a80fc42074122fa29579b387564b2dbe39526dd607519a4c3b3611ff584ed4cb311e379291e6e4c7c620ac0a30c6650da2ecd588f974d62207"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0x8fa9802b9b8dd84ad1494ab0044adb9c9f280732ab6fef67b248cee44cc4c9ed",
"hash": "0x454dcd76c7a06eebaf8674a72bb4ecd991b268047a6af9bba9fc15a8baa49af2",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x5af9b9a59f186b457d40ec7816b6256af0fbcddf9501d16707c59cdcadc083d1",
"accumulator_root_hash": "0x5615a2721740f90cb8356092758ca18ddcb8abec3142d07decc1abae8f6e8c4f",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0xe45663a924a9cf39ef514bc757ade054a5b645ba566cd321a175641709c73a67179593236e5e760ead09e61c5669444c95a6f31782d3c3034ef5d8dae86e3a0c"
"signature": "0x81e2ab66fa12b54e04da680d05170c9900de19c3e52df49c4f88654ed921ae1ce6d6d1e7dacc9f5745e7caa430164b9de6ea39b3000ada74c1b6ce73e643810c"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0xfb4cb05816a067c3dc02df8b628a2924c030937599565fb317de48736cd98b4d",
"hash": "0xc00c694596b002f38c4a5eb5b8b20a772cb2bc7e5aacd3b2637e73bec802796e",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xe230db820b9cc539eb3015efe879485080f4c412899543ceb55ecc9264eaf40e",
"accumulator_root_hash": "0xead860f4e74eb60322b2541de88593e12489ecefedd4b7d9d12fd8febe7cd7d8",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x446060cb7b869883cb022bf6ea5e78a3c9bd454410f12904fd17c2f6041019cabdd1c6149b3974a389c49e9e416c994c1ccc6b7cc15be3a2ef3440e353ddad0d"
"signature": "0x892be42783ef9c1b512e10ec1e9b0a38c820999d286607af02bf4b9e2ffeb6d536e9ba0f0fc5823b7635d7ccac987186f15c438a10a58a11319435c06c38200a"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0x2bf7670f9cea191af66917f1a2d3592fe82c9d004b66ab62ac8162e6d45af145",
"hash": "0xd99666ee3f06d5d564d1e8bf5955a020e7634fd9b539c2b6bab071670548f625",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xb82293ca315faa6bf86c6ab5ccc9992c0403e32025443f6dd1346705df2fe373",
"accumulator_root_hash": "0xb2215f876bd4656820661f75e76ef534733b40cefe6a22cd109ad19a20d454cc",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x7c0138e74c71b9178ecedcd2feb19379db4f867c17cbb9eca630d3dce4017e1fe1802afedd1648edbf1cca16064abf9a4a52964eb5cc7b776eef2136f3d9bb04"
"signature": "0x13f4a33ffb8189fc0c13875055ca2f8e6b22b2a1ea9f9348cb5e68613c36aea8c2530b03ef27ca6a393b7484e2afe4dc8c4128a84b77bedeef4b2bff8651fa03"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "2",
"hash": "0xf0f0fcfd90c806e9985fceabcc836b172007cc3490641a8830c1ff8684a50485",
"hash": "0x8df66affad9c571750829820259721f96af4d7ae787bd7089bea259ff0f82cb1",
"state_root_hash": "0x9bcdf1518ffbac5de7d4f703c266fb87f80d1e4795f6fcf8bbad5aac9234a825",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x4cb39ffe2f2dcf97ea936c3d59732d36931a12522c74fcad83f8320b4ef2f702",
"accumulator_root_hash": "0x9fb96d4a2c2aae2c720d4f221f4d0c76f063f2a70dcde0458641727a290828e5",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -65,7 +64,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0x488f4347b71e958a33c56b789d437059b19363006a6aff3df33e5959ca922b8995d49b111ab140a6240e2ce743cdbb005a447ab8860c0d1fa889675a48de5a08"
"signature": "0xb3b869bfff28a9cebbe598481e595a9baa4e615e95e895d47127908776e6b5ad8c60d72808b22db79798e5323dc2640c3a7c94e7057ed205db619e255292d70d"
},
"events": [],
"timestamp": "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"type": "user_transaction",
"version": "4",
"hash": "0x6bb8523ed342ba8f8142042b77e08c1d4fad3ba6673f109f37cd0865adafbd1c",
"hash": "0x67d3d83ebf873c54ae08380b8984ee3bef0227c284117384b9e086498c52fb90",
"state_root_hash": "0x80dd9bb6f17a2a9832b26a7904335fd4d0795d0b7e0fcc89f7379823acb9d5eb",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "26",
"success": false,
"vm_status": "Move abort by LIMIT_EXCEEDED - EINSUFFICIENT_BALANCE\n A limit on an amount, e.g. a currency, is exceeded. Example: withdrawal of money after account limits window\n is exhausted.\n Error codes",
"accumulator_root_hash": "0x9ab3aca5b9cb7f4b95cae3367486a31dc8b0eb4cebe36a4757d44bf77c54b0cf",
"accumulator_root_hash": "0xcced2263a0b0355bd3f01611566bdfbb877bc8f72a80990cf87e6487dbce4122",
"changes": [
{
"type": "write_resource",
Expand Down Expand Up @@ -52,7 +52,6 @@
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -66,7 +65,7 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xafb4905e9550cf462a82007824a055d975ae934470c477d9ddbb6d2b264c36fa",
"signature": "0xbf29e08e9d3ecad55cf6f00fdd1c4b9792621012a2c572509d9de53f1dd6736e2ac7df52dd617c5fc683ab1e63241833b52882d1050c41fcf9400663ddf2ce07"
"signature": "0x54182ebf4aef3031c730e2e63fae4363e0f15540ceb4ab9d064f7f9adc6d8c648ec6a52648097a32024509fce45767ed4aedb0ab3a719baed233633e1264b60c"
},
"events": [],
"timestamp": "2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"type": "pending_transaction",
"hash": "0x2eefdb1220b8b58b7a70f789c604ea5b95b48a60da2bd2606a0f966c85c703ad",
"hash": "0x18073cb2536317833aa630d30062383a1f00221dd3604bbce19cd262813e6c36",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "2000",
"gas_unit_price": "0",
"gas_currency_code": "XUS",
"expiration_timestamp_secs": "18446744073709551615",
"payload": {
"type": "script_function_payload",
Expand All @@ -18,6 +17,6 @@
"signature": {
"type": "ed25519_signature",
"public_key": "0xb9c6ee1630ef3e711144a648db06bbb2284f7274cfbee53ffcee503cc1a49200",
"signature": "0xbf496107afc5d31cf1b4f1dc79ddc745851e0ceb91cd9c77e938a5896c696e9674d0643ff41a74cb430a376e17878931f020d13c4590a815e58ce89c5431d209"
"signature": "0xb66feafc1e1b95ce33a8e25101a212cdfd4e94a7dfd85409ad538ce7fcc150b610326a97e688b1d02bb4703880631498588784c8128824671b219d6aca6edb04"
}
}
2 changes: 0 additions & 2 deletions api/src/tests/transactions_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ async fn test_signing_message_with_write_set_payload() {
"sequence_number": sender.sequence_number().to_string(),
"gas_unit_price": txn.gas_unit_price().to_string(),
"max_gas_amount": txn.max_gas_amount().to_string(),
"gas_currency_code": txn.gas_currency_code(),
"expiration_timestamp_secs": txn.expiration_timestamp_secs().to_string(),
"payload": payload,
});
Expand All @@ -627,7 +626,6 @@ async fn test_signing_message_with_payload(
"sequence_number": sender.sequence_number().to_string(),
"gas_unit_price": txn.gas_unit_price().to_string(),
"max_gas_amount": txn.max_gas_amount().to_string(),
"gas_currency_code": txn.gas_currency_code(),
"expiration_timestamp_secs": txn.expiration_timestamp_secs().to_string(),
"payload": payload,
});
Expand Down
2 changes: 0 additions & 2 deletions api/types/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ impl<'a, R: MoveResolver + ?Sized> MoveConverter<'a, R> {
sequence_number,
max_gas_amount,
gas_unit_price,
gas_currency_code,
expiration_timestamp_secs,
payload,
signature: _,
Expand All @@ -304,7 +303,6 @@ impl<'a, R: MoveResolver + ?Sized> MoveConverter<'a, R> {
self.try_into_aptos_core_transaction_payload(payload)?,
max_gas_amount.into(),
gas_unit_price.into(),
gas_currency_code,
expiration_timestamp_secs.into(),
chain_id,
))
Expand Down
2 changes: 0 additions & 2 deletions api/types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ impl From<(&SignedTransaction, TransactionPayload)> for UserTransactionRequest {
sequence_number: txn.sequence_number().into(),
max_gas_amount: txn.max_gas_amount().into(),
gas_unit_price: txn.gas_unit_price().into(),
gas_currency_code: txn.gas_currency_code().to_owned(),
expiration_timestamp_secs: txn.expiration_timestamp_secs().into(),
signature: Some(txn.authenticator().into()),
payload,
Expand Down Expand Up @@ -327,7 +326,6 @@ pub struct UserTransactionRequest {
pub sequence_number: U64,
pub max_gas_amount: U64,
pub gas_unit_price: U64,
pub gas_currency_code: String,
pub expiration_timestamp_secs: U64,
pub payload: TransactionPayload,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
Loading

0 comments on commit 17de4fb

Please sign in to comment.