From 4eed61468871bac4462e2aa8589ddcdd0dcdc43a Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 24 May 2024 09:19:44 +0200 Subject: [PATCH 1/5] Update node to 2.14.7 --- .project.json | 4 +++- artifacts/add/Add.ral.json | 2 +- artifacts/add/DestroyAdd.ral.json | 2 +- artifacts/add/Main.ral.json | 2 +- artifacts/greeter/Greeter.ral.json | 2 +- artifacts/greeter/GreeterMain.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest1.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest2.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest3.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest4.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest5.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest6.ral.json | 2 +- artifacts/nft/DeprecatedNFTTest7.ral.json | 2 +- artifacts/nft/MintNFTTest.ral.json | 2 +- artifacts/nft/NFTCollectionTest.ral.json | 2 +- artifacts/nft/NFTCollectionWithRoyaltyTest.ral.json | 2 +- artifacts/nft/NFTTest.ral.json | 2 +- artifacts/nft/WithdrawNFTCollectionTest.ral.json | 2 +- artifacts/nft/WrongNFTTest.ral.json | 2 +- artifacts/sub/Sub.ral.json | 2 +- artifacts/test/Assert.ral.json | 2 +- artifacts/test/Debug.ral.json | 2 +- artifacts/test/InsertIntoMap.ral.json | 2 +- artifacts/test/MapTest.ral.json | 2 +- artifacts/test/MetaData.ral.json | 2 +- artifacts/test/OwnerOnly.ral.json | 2 +- artifacts/test/RemoveFromMap.ral.json | 2 +- artifacts/test/TemplateArrayVar.ral.json | 2 +- artifacts/test/TestAssert.ral.json | 2 +- artifacts/test/UpdateMapValue.ral.json | 2 +- artifacts/test/UpdateUserAccount.ral.json | 2 +- artifacts/test/UserAccount.ral.json | 2 +- artifacts/test/Warnings.ral.json | 2 +- artifacts/token/FakeTokenTest.ral.json | 2 +- artifacts/token/TokenTest.ral.json | 2 +- docker/docker-compose.yml | 2 +- 36 files changed, 38 insertions(+), 36 deletions(-) diff --git a/.project.json b/.project.json index c7c99823d..8a3d00edb 100644 --- a/.project.json +++ b/.project.json @@ -1,5 +1,5 @@ { - "fullNodeVersion": "v2.14.0", + "fullNodeVersion": "v2.14.7", "compilerOptionsUsed": { "ignoreUnusedConstantsWarnings": false, "ignoreUnusedVariablesWarnings": false, @@ -186,6 +186,8 @@ "bytecodeDebugPatch": "=6-2+73=2-2+d8=2-2+69=11-1+a=50+7a7e0214696e73657274206174206d617020706174683a2000=56+7a7e0214696e73657274206174206d617020706174683a2000=227-1+9=124+7a7e021472656d6f7665206174206d617020706174683a2000=46+7a7e021472656d6f7665206174206d617020706174683a2000=6", "codeHashDebug": "034dec32e1107787800ec476a31b11ed2f5c201c06aa9360d1a1a074d6b29098", "warnings": [ + "No external caller check for function \"MapTest.remove\". Please use \"checkCaller!(...)\" in the function or its callees, or disable it with \"@using(checkExternalCaller = false)\".", + "No external caller check for function \"MapTest.update\". Please use \"checkCaller!(...)\" in the function or its callees, or disable it with \"@using(checkExternalCaller = false)\".", "No external caller check for function \"MapTest.insert\". Please use \"checkCaller!(...)\" in the function or its callees, or disable it with \"@using(checkExternalCaller = false)\"." ] }, diff --git a/artifacts/add/Add.ral.json b/artifacts/add/Add.ral.json index edcb7cc39..412a24d35 100644 --- a/artifacts/add/Add.ral.json +++ b/artifacts/add/Add.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Add", "bytecode": "020412403b4060406e010002040205d34fbb20db1600160100010200000202021605160016015f06160016015fa00016002a16012aa100a000160016010e0dce00010002010304060011d319adf50e1300641600130164170517041603d1a21601160216041605c118010201010003d320f98f621600b0", "codeHash": "22b684b29b60a12a9094fa221b86cbab12e0547113c8c5806401f7797a9c809b", diff --git a/artifacts/add/DestroyAdd.ral.json b/artifacts/add/DestroyAdd.ral.json index 4cc7d541c..ffe0caf3f 100644 --- a/artifacts/add/DestroyAdd.ral.json +++ b/artifacts/add/DestroyAdd.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DestroyAdd", "bytecodeTemplate": "01010300000005{1}0d0c{0}0103", "fieldsSig": { diff --git a/artifacts/add/Main.ral.json b/artifacts/add/Main.ral.json index 957c46ed6..88ef2d593 100644 --- a/artifacts/add/Main.ral.json +++ b/artifacts/add/Main.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Main", "bytecodeTemplate": "0101030001000a{0}17000e0d0e0e160001001818", "fieldsSig": { diff --git a/artifacts/greeter/Greeter.ral.json b/artifacts/greeter/Greeter.ral.json index da1f3720c..114f6a844 100644 --- a/artifacts/greeter/Greeter.ral.json +++ b/artifacts/greeter/Greeter.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Greeter", "bytecode": "19010c010000000105030c7bce0002", "codeHash": "3813cf61a6e0f126463190119cd861a14ca9c2f92839e193c4f9934517b02477", diff --git a/artifacts/greeter/GreeterMain.ral.json b/artifacts/greeter/GreeterMain.ral.json index 71c124822..b4fd00302 100644 --- a/artifacts/greeter/GreeterMain.ral.json +++ b/artifacts/greeter/GreeterMain.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "GreeterMain", "bytecodeTemplate": "01010300020014{0}17000c0d160001000d2f0c7b{0}17010c0d160101000d2f0c7b", "fieldsSig": { diff --git a/artifacts/nft/DeprecatedNFTTest1.ral.json b/artifacts/nft/DeprecatedNFTTest1.ral.json index 2acc92cc0..9126d5139 100644 --- a/artifacts/nft/DeprecatedNFTTest1.ral.json +++ b/artifacts/nft/DeprecatedNFTTest1.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest1", "bytecode": "02010e010000000103d3ee6a5cd5ce0102", "codeHash": "cc6928c9c6777077abcb5b9c4f7c5d620d6cae07ec6f00f5e8b0efe6a7b913c4", diff --git a/artifacts/nft/DeprecatedNFTTest2.ral.json b/artifacts/nft/DeprecatedNFTTest2.ral.json index 83334953f..d82bfb870 100644 --- a/artifacts/nft/DeprecatedNFTTest2.ral.json +++ b/artifacts/nft/DeprecatedNFTTest2.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest2", "bytecode": "02020e1c010000000103d3ee6a5cd5ce0102010000000103d33e65d93dce0002", "codeHash": "ade9aee476ee752050a1e9e1b19039f05261cb3f53941152617174faf9eae572", diff --git a/artifacts/nft/DeprecatedNFTTest3.ral.json b/artifacts/nft/DeprecatedNFTTest3.ral.json index 51681748d..2727f77bc 100644 --- a/artifacts/nft/DeprecatedNFTTest3.ral.json +++ b/artifacts/nft/DeprecatedNFTTest3.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest3", "bytecode": "02020e19010000000103d3ee6a5cd5ce0102010000000001d34d12f529", "codeHash": "465bc3739cd1649e58e0470971bd2fabf21363ab9fc2c15052fb2440dd06ada5", diff --git a/artifacts/nft/DeprecatedNFTTest4.ral.json b/artifacts/nft/DeprecatedNFTTest4.ral.json index c79dd47af..1b82de482 100644 --- a/artifacts/nft/DeprecatedNFTTest4.ral.json +++ b/artifacts/nft/DeprecatedNFTTest4.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest4", "bytecode": "02020e1b010000000103d3ee6a5cd5ce0102010000000103d35f9a418a0402", "codeHash": "a5de0fa0b3580303ac63423f09ce5ed95fccbf789679b32130a53c26fef182e9", diff --git a/artifacts/nft/DeprecatedNFTTest5.ral.json b/artifacts/nft/DeprecatedNFTTest5.ral.json index 8aa24c6f5..f7690c922 100644 --- a/artifacts/nft/DeprecatedNFTTest5.ral.json +++ b/artifacts/nft/DeprecatedNFTTest5.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest5", "bytecode": "02020e1e010000000103d3ee6a5cd5ce0102010000000305d35c9ec8a3ce000c0c02", "codeHash": "8b1374f39db98c485af3dd05d0b0ce861e9528f290ca9dc0d7108e8b48b50161", diff --git a/artifacts/nft/DeprecatedNFTTest6.ral.json b/artifacts/nft/DeprecatedNFTTest6.ral.json index 6fa2af525..75337a63e 100644 --- a/artifacts/nft/DeprecatedNFTTest6.ral.json +++ b/artifacts/nft/DeprecatedNFTTest6.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest6", "bytecode": "02020e1c010000000103d3ee6a5cd5ce0102010000000204d30e0a3ac10c0d02", "codeHash": "8bc0d39f0607d4a771ec70ae1057b71dbcde404177cb3b25fd7d93d553a2b8cd", diff --git a/artifacts/nft/DeprecatedNFTTest7.ral.json b/artifacts/nft/DeprecatedNFTTest7.ral.json index 833b1264c..c465f4176 100644 --- a/artifacts/nft/DeprecatedNFTTest7.ral.json +++ b/artifacts/nft/DeprecatedNFTTest7.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "DeprecatedNFTTest7", "bytecode": "02020e1d010000000103d3ee6a5cd5ce0102010000000204d3289dd321ce000b02", "codeHash": "b95c9acf088b090f5d9d34f28ab079cf22b9e53af8ae6864113c71172231ef4c", diff --git a/artifacts/nft/MintNFTTest.ral.json b/artifacts/nft/MintNFTTest.ral.json index c4d49d8f8..f802c2827 100644 --- a/artifacts/nft/MintNFTTest.ral.json +++ b/artifacts/nft/MintNFTTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "MintNFTTest", "bytecodeTemplate": "01010300000015{2}4c0ab413c40de0b6b3a7640000a2{1}0d0d{0}0107184a09b413c40de0b6b3a7640000a2{1}0d0d{0}010418", "fieldsSig": { diff --git a/artifacts/nft/NFTCollectionTest.ral.json b/artifacts/nft/NFTCollectionTest.ral.json index 47240fd9f..99d9682d7 100644 --- a/artifacts/nft/NFTCollectionTest.ral.json +++ b/artifacts/nft/NFTCollectionTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "NFTCollectionTest", "bytecode": "04050912402d4040408a010000000102ce0102010000000102a0000201000102010f16000001310c7b160040cb17011601c50d7b16010201000203000816010002170216001602410e7b01030105011fd3b8b591eeb41701b1a00016001406414c5048000313046413006417031702160113c40de0b6b3a7640000a2a00040ce00160216030d1601c91704a0000d2aa100160402", "codeHash": "087f9292bb326a4d39a6fac09928cb25edf2837718f830f3a166a937f8724779", diff --git a/artifacts/nft/NFTCollectionWithRoyaltyTest.ral.json b/artifacts/nft/NFTCollectionWithRoyaltyTest.ral.json index 4858b7479..a3fafbb20 100644 --- a/artifacts/nft/NFTCollectionWithRoyaltyTest.ral.json +++ b/artifacts/nft/NFTCollectionWithRoyaltyTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "NFTCollectionWithRoyaltyTest", "bytecode": "06080912402d40404050405b406c40b6010000000102ce0102010000000102a0000201000102010f16000001310c7b160040cb17011601c50d7b16010201000203000816010002170216001602410e7b0100020201061601ce032c1367102d0201010202000316001601a9010202020008b4ce02450d7b16001601a801030105011fd3b8b591eeb41701b1a00016001406414c5048000313046413006417031702160113c40de0b6b3a7640000a2a00040ce00160216030d1601c91704a0000d2aa100160402", "codeHash": "919808beff802a8043d62c5ff23249f22dbfdbd2fae56264f5f108af59eb171e", diff --git a/artifacts/nft/NFTTest.ral.json b/artifacts/nft/NFTTest.ral.json index 93b9dc909..d41c52679 100644 --- a/artifacts/nft/NFTTest.ral.json +++ b/artifacts/nft/NFTTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "NFTTest", "bytecode": "04020914010000000102ce0202010000000203ce00ce0102", "codeHash": "4897086210869e612d82995b765a447c5319a55a56e8a0c3c07b4d9ca81e15b1", diff --git a/artifacts/nft/WithdrawNFTCollectionTest.ral.json b/artifacts/nft/WithdrawNFTCollectionTest.ral.json index e6d7e97f0..6786d5955 100644 --- a/artifacts/nft/WithdrawNFTCollectionTest.ral.json +++ b/artifacts/nft/WithdrawNFTCollectionTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "WithdrawNFTCollectionTest", "bytecodeTemplate": "01010300000006b4{1}0e0c{0}0106", "fieldsSig": { diff --git a/artifacts/nft/WrongNFTTest.ral.json b/artifacts/nft/WrongNFTTest.ral.json index e0fa5bf0a..f65d1e36b 100644 --- a/artifacts/nft/WrongNFTTest.ral.json +++ b/artifacts/nft/WrongNFTTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "WrongNFTTest", "bytecode": "04020917010000000102ce0202010000000206040c7bce00ce0102", "codeHash": "7dd2ed643a98b2a1a52a9b9e536fcdae60d961b583b8109f777d846bfdfcae8d", diff --git a/artifacts/sub/Sub.ral.json b/artifacts/sub/Sub.ral.json index 8b1fe513f..dc37e58cb 100644 --- a/artifacts/sub/Sub.ral.json +++ b/artifacts/sub/Sub.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Sub", "bytecode": "01011e01000202010dd321939f9e05160016015fa00016002a16012ba100a00002", "codeHash": "3461ebfaca02ad0a3f587a5b67a461c0cbd82d14261407b1d9277ed4ad129234", diff --git a/artifacts/test/Assert.ral.json b/artifacts/test/Assert.ral.json index f9b0d3fb2..f5cf36594 100644 --- a/artifacts/test/Assert.ral.json +++ b/artifacts/test/Assert.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Assert", "bytecode": "000110010000000006d362d460120d0e2f0f7b", "codeHash": "46dc5e3835be6551dacbf81565912ec67575aa77522312ceed88472817735d6b", diff --git a/artifacts/test/Debug.ral.json b/artifacts/test/Debug.ral.json index e2302df04..71b93d36f 100644 --- a/artifacts/test/Debug.ral.json +++ b/artifacts/test/Debug.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Debug", "bytecode": "00010b010000000001d38681d619", "codeHash": "cc0e1966e6847f2c03384e78df1dcd9a0c2b5db1b7c1e901d66e26e2b000eb2c", diff --git a/artifacts/test/InsertIntoMap.ral.json b/artifacts/test/InsertIntoMap.ral.json index 2962afb95..aa9d9ae58 100644 --- a/artifacts/test/InsertIntoMap.ral.json +++ b/artifacts/test/InsertIntoMap.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "InsertIntoMap", "bytecodeTemplate": "01010300020010{2}{3}17011700{1}d10e2ca2{1}160016010f0c{0}0100", "fieldsSig": { diff --git a/artifacts/test/MapTest.ral.json b/artifacts/test/MapTest.ral.json index 0fa571520..fe98914b2 100644 --- a/artifacts/test/MapTest.ral.json +++ b/artifacts/test/MapTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "MapTest", "bytecode": "0003404140a64105010303030016d3a9cdcc691600d1a2140a5f5f6d61705f5f305f5f160047441601b11602d202011600d1a2140a5f5f6d61705f5f315f5f16014044b11602d201010100010400402bd3c50ed2bb0c0d0d140a5f5f6d61705f5f305f5f16004744cb1703160301000c0d0d160301011702170116020d2a0c0e0c140a5f5f6d61705f5f305f5f16004744cb010216020d2a0c0e0c140a5f5f6d61705f5f315f5f16014044cb010201000104004025d392ac08660c0d0d140a5f5f6d61705f5f305f5f16004744cb1703160301000c0d0d160301011702170116000d0c140a5f5f6d61705f5f305f5f16004744cb010316000d0c140a5f5f6d61705f5f315f5f16014044cb0103", "codeHash": "fa153233f4924fc2fd3e98b43209b838e569154481211662acdade8e20bb48c0", diff --git a/artifacts/test/MetaData.ral.json b/artifacts/test/MetaData.ral.json index 988ed0173..9560d9993 100644 --- a/artifacts/test/MetaData.ral.json +++ b/artifacts/test/MetaData.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "MetaData", "bytecode": "000319402c4033010300000006d38d0b3636b4b413c40de0b6b3a7640000a702000200000004b213c40de0b6b3a7640000a90200000000000102", "codeHash": "af0b3119565ef5f833f7b3514005a6b00ac9957d5a7779765edfc6e6ce6321c5", diff --git a/artifacts/test/OwnerOnly.ral.json b/artifacts/test/OwnerOnly.ral.json index d6dbbd694..3ba0c9504 100644 --- a/artifacts/test/OwnerOnly.ral.json +++ b/artifacts/test/OwnerOnly.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "OwnerOnly", "bytecode": "010111010000000006d3bf853dbdb4ce00450c7b", "codeHash": "c8ecfd7b7e1f3d0169d80e0abb59702516eeff301d47e0e7be70a631bd9414ca", diff --git a/artifacts/test/RemoveFromMap.ral.json b/artifacts/test/RemoveFromMap.ral.json index f0c25dda3..b09474b40 100644 --- a/artifacts/test/RemoveFromMap.ral.json +++ b/artifacts/test/RemoveFromMap.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "RemoveFromMap", "bytecodeTemplate": "01010300000005{1}0d0c{0}0102", "fieldsSig": { diff --git a/artifacts/test/TemplateArrayVar.ral.json b/artifacts/test/TemplateArrayVar.ral.json index 51883d9bb..539312253 100644 --- a/artifacts/test/TemplateArrayVar.ral.json +++ b/artifacts/test/TemplateArrayVar.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "TemplateArrayVar", "bytecodeTemplate": "010103000e00408d{1}{2}{3}{4}1703170217011700{6}{7}{8}170617051704{0}18{5}1816030f2f16020e2f1a16010d2f1a16000c2f1a0c7b160016011708170716070c2f16080d2f1a0c7b16021603170a170916090e2f160a0f2f1a0c7b16060e2f16050d2f1a16040c2f1a0c7b0c170b160b0e314c40260c170c160c0e314c1b160b7a0e314d0e2c160c7a0e314d2a78160b0e2c160c2a2f0c7b160c0d2a170c4a21160b0d2a170b4a7fd60c170d160d0f314c11160d7a0f314d102a78160d2f0c7b160d0d2a170d4a2b", "fieldsSig": { diff --git a/artifacts/test/TestAssert.ral.json b/artifacts/test/TestAssert.ral.json index 4342c677c..d1c50c77a 100644 --- a/artifacts/test/TestAssert.ral.json +++ b/artifacts/test/TestAssert.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "TestAssert", "bytecodeTemplate": "010103000000040c0c{0}0100", "fieldsSig": { diff --git a/artifacts/test/UpdateMapValue.ral.json b/artifacts/test/UpdateMapValue.ral.json index fcc9b4f0e..d995f5797 100644 --- a/artifacts/test/UpdateMapValue.ral.json +++ b/artifacts/test/UpdateMapValue.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "UpdateMapValue", "bytecodeTemplate": "01010300000005{1}0d0c{0}0101", "fieldsSig": { diff --git a/artifacts/test/UpdateUserAccount.ral.json b/artifacts/test/UpdateUserAccount.ral.json index 1c500f979..2c2ed16a6 100644 --- a/artifacts/test/UpdateUserAccount.ral.json +++ b/artifacts/test/UpdateUserAccount.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "UpdateUserAccount", "bytecodeTemplate": "01010300040015{1}{2}{3}{4}17031702170117001600160116021603100c{0}0100{5}0d0c{0}0101", "fieldsSig": { diff --git a/artifacts/test/UserAccount.ral.json b/artifacts/test/UserAccount.ral.json index 01996e232..30c611943 100644 --- a/artifacts/test/UserAccount.ral.json +++ b/artifacts/test/UserAccount.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "UserAccount", "bytecode": "080340284037404d010004040013d388b067e71600ce01410c7b1602ce02410c7b1601a1021603a103160116032aa101010001010003d3185a39e11600a100010000000507d384cc0995a001ce01a002ce02a00302", "codeHash": "4e9f7eac1b76eaa2268b5af6ebb5640252892dc170aad6c1ee7b639131a55816", diff --git a/artifacts/test/Warnings.ral.json b/artifacts/test/Warnings.ral.json index b3d200be6..43ff5b697 100644 --- a/artifacts/test/Warnings.ral.json +++ b/artifacts/test/Warnings.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "Warnings", "bytecode": "02010c010002020002d31bbce4a602", "codeHash": "873e095edb39cdb4b11b1157003daeacad06d259a938cd270e22b8e89b75feea", diff --git a/artifacts/token/FakeTokenTest.ral.json b/artifacts/token/FakeTokenTest.ral.json index e4e7c5d83..4208d7d66 100644 --- a/artifacts/token/FakeTokenTest.ral.json +++ b/artifacts/token/FakeTokenTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "FakeTokenTest", "bytecode": "010509121b4024402f010000000103044d18010000000103044d18010000000103044d18010000000103044d18010000000001d38d0b3636", "codeHash": "52f971cb44d54a5353e94dc8db991d2726f76760af782e79bd8a66a9b5b294b7", diff --git a/artifacts/token/TokenTest.ral.json b/artifacts/token/TokenTest.ral.json index 5457fb9ea..1fea0726a 100644 --- a/artifacts/token/TokenTest.ral.json +++ b/artifacts/token/TokenTest.ral.json @@ -1,5 +1,5 @@ { - "version": "v2.14.0", + "version": "v2.14.7", "name": "TokenTest", "bytecode": "050409121b4024010000000102ce0002010000000102ce0102010000000102ce0202010000000102ce0302", "codeHash": "a2800413eb2c5c23d48068db23df5f8eeaba04653e12c8ed59d589720d96dadd", diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 91f5b6125..d7ecc03fa 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -31,7 +31,7 @@ services: condition: service_healthy alephium: - image: alephium/alephium:v2.14.0 + image: alephium/alephium:v2.14.7 restart: unless-stopped ports: - 19973:19973/tcp From 2538eb2fa304248c6ef92eac7ad783c91f26151e Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 24 May 2024 09:21:00 +0200 Subject: [PATCH 2/5] Add TxScript codec --- .../web3/src/codec/txscript-codec.test.ts | 68 +++++++++++++++++++ packages/web3/src/codec/txscript-codec.ts | 53 +++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 packages/web3/src/codec/txscript-codec.test.ts create mode 100644 packages/web3/src/codec/txscript-codec.ts diff --git a/packages/web3/src/codec/txscript-codec.test.ts b/packages/web3/src/codec/txscript-codec.test.ts new file mode 100644 index 000000000..5848ba4b1 --- /dev/null +++ b/packages/web3/src/codec/txscript-codec.test.ts @@ -0,0 +1,68 @@ +/* +Copyright 2018 - 2022 The Alephium Authors +This file is part of the alephium project. + +The library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the library. If not, see . +*/ + +import { AddressConst, ByteConst, CallExternal, U256Const0, U256Const1 } from './instr-codec' +import { Buffer } from 'buffer/' +import { DestroyAdd } from '../../../../artifacts/ts' +import { LockupScript } from './lockup-script-codec' +import { Method } from './method-codec' +import { Script, Fields, bs58 } from '@alephium/web3' +import { randomContractId, testAddress } from '@alephium/web3-test' +import { txScriptCodec } from './txscript-codec' + +describe('Encode & decode TxScript', function () { + it('should encode & decode TxScript', () => { + const contractId = randomContractId() + const decodedTestAddress = Buffer.from(bs58.decode(testAddress)) + const lockupScript = { + scriptType: decodedTestAddress[0], + script: { + publicKeyHash: decodedTestAddress.slice(1) + } + } as LockupScript + const contractIdByteString = { + length: { mode: 64, rest: Buffer.from(['32']) }, + value: Buffer.from(contractId, 'hex') + } + + testTxScript(DestroyAdd.script, { add: contractId, caller: testAddress }, [ + { + isPublic: true, + assetModifier: 3, + argsLength: 0, + localsLength: 0, + returnLength: 0, + instrs: [AddressConst(lockupScript), U256Const1, U256Const0, ByteConst(contractIdByteString), CallExternal(3)] + } + ]) + }) + + function testTxScript(script: Script, fields: Fields, methods: Method[]) { + const bytecode = script.buildByteCodeToDeploy(fields) + const decodedTxScript = txScriptCodec.decodeTxScript(Buffer.from(bytecode, 'hex')) + expect(decodedTxScript.methods.length).toEqual(methods.length) + decodedTxScript.methods.map((decodedMethod, index) => { + expect(decodedMethod.isPublic).toEqual(methods[index].isPublic) + expect(decodedMethod.assetModifier).toEqual(methods[index].assetModifier) + expect(decodedMethod.argsLength).toEqual(methods[index].argsLength) + expect(decodedMethod.localsLength).toEqual(methods[index].localsLength) + expect(decodedMethod.returnLength).toEqual(methods[index].returnLength) + expect(decodedMethod.instrs).toEqual(methods[index].instrs) + }) + } +}) diff --git a/packages/web3/src/codec/txscript-codec.ts b/packages/web3/src/codec/txscript-codec.ts new file mode 100644 index 000000000..21cff1475 --- /dev/null +++ b/packages/web3/src/codec/txscript-codec.ts @@ -0,0 +1,53 @@ +/* +Copyright 2018 - 2022 The Alephium Authors +This file is part of the alephium project. + +The library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +The library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with the library. If not, see . +*/ + +import { Buffer } from 'buffer/' +import { Parser } from 'binary-parser' +import { DecodedArray } from './array-codec' +import { Codec } from './codec' +import { DecodedMethod, Method, MethodCodec, methodsCodec } from './method-codec' + +export interface DecodedTxScript { + methods: DecodedArray +} + +export interface TxScript { + methods: Method[] +} + +export class TxScriptCodec implements Codec { + parser = Parser.start().nest('methods', { + type: methodsCodec.parser + }) + + encode(input: DecodedTxScript): Buffer { + return methodsCodec.encode(input.methods.value) + } + + decode(input: Buffer): DecodedTxScript { + return this.parser.parse(input) + } + + decodeTxScript(input: Buffer): TxScript { + const decodedTxScript = this.decode(input) + const methods = decodedTxScript.methods.value.map((decodedMethod) => MethodCodec.toMethod(decodedMethod)) + return { methods } + } +} + +export const txScriptCodec = new TxScriptCodec() From 7293e7618dd59d55d09bc03b6b50475376b45009 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 24 May 2024 09:45:32 +0200 Subject: [PATCH 3/5] Add more test --- .../web3/src/codec/txscript-codec.test.ts | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/packages/web3/src/codec/txscript-codec.test.ts b/packages/web3/src/codec/txscript-codec.test.ts index 5848ba4b1..b6ddcbfa9 100644 --- a/packages/web3/src/codec/txscript-codec.test.ts +++ b/packages/web3/src/codec/txscript-codec.test.ts @@ -16,14 +16,24 @@ You should have received a copy of the GNU Lesser General Public License along with the library. If not, see . */ -import { AddressConst, ByteConst, CallExternal, U256Const0, U256Const1 } from './instr-codec' +import { + AddressConst, + AssertWithErrorCode, + ByteConst, + CallExternal, + LoadLocal, + U256Const0, + U256Const1, + U256Eq +} from './instr-codec' import { Buffer } from 'buffer/' -import { DestroyAdd } from '../../../../artifacts/ts' +import { DestroyAdd, GreeterMain } from '../../../../artifacts/ts' import { LockupScript } from './lockup-script-codec' import { Method } from './method-codec' import { Script, Fields, bs58 } from '@alephium/web3' import { randomContractId, testAddress } from '@alephium/web3-test' import { txScriptCodec } from './txscript-codec' +import { StoreLocal } from '../../dist/src/codec' describe('Encode & decode TxScript', function () { it('should encode & decode TxScript', () => { @@ -50,6 +60,38 @@ describe('Encode & decode TxScript', function () { instrs: [AddressConst(lockupScript), U256Const1, U256Const0, ByteConst(contractIdByteString), CallExternal(3)] } ]) + + testTxScript(GreeterMain.script, { greeterContractId: contractId }, [ + { + isPublic: true, + assetModifier: 3, + argsLength: 0, + localsLength: 2, + returnLength: 0, + instrs: [ + ByteConst(contractIdByteString), + StoreLocal(0), + U256Const0, + U256Const1, + LoadLocal(0), + CallExternal(0), + U256Const1, + U256Eq, + U256Const0, + AssertWithErrorCode, + ByteConst(contractIdByteString), + StoreLocal(1), + U256Const0, + U256Const1, + LoadLocal(1), + CallExternal(0), + U256Const1, + U256Eq, + U256Const0, + AssertWithErrorCode + ] + } + ]) }) function testTxScript(script: Script, fields: Fields, methods: Method[]) { From d98a3d1dec39dd780dc26ebb4366a660ce55236a Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 24 May 2024 10:11:30 +0200 Subject: [PATCH 4/5] Add TxScriptCodec.encodeTxScript --- packages/web3/src/codec/txscript-codec.test.ts | 7 +++++-- packages/web3/src/codec/txscript-codec.ts | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/web3/src/codec/txscript-codec.test.ts b/packages/web3/src/codec/txscript-codec.test.ts index b6ddcbfa9..78fe8e4bc 100644 --- a/packages/web3/src/codec/txscript-codec.test.ts +++ b/packages/web3/src/codec/txscript-codec.test.ts @@ -95,8 +95,11 @@ describe('Encode & decode TxScript', function () { }) function testTxScript(script: Script, fields: Fields, methods: Method[]) { - const bytecode = script.buildByteCodeToDeploy(fields) - const decodedTxScript = txScriptCodec.decodeTxScript(Buffer.from(bytecode, 'hex')) + const txScriptBytecode = script.buildByteCodeToDeploy(fields) + const decodedTxScript = txScriptCodec.decodeTxScript(Buffer.from(txScriptBytecode, 'hex')) + + expect(txScriptCodec.encodeTxScript(decodedTxScript).toString('hex')).toEqual(txScriptBytecode) + expect(decodedTxScript.methods.length).toEqual(methods.length) decodedTxScript.methods.map((decodedMethod, index) => { expect(decodedMethod.isPublic).toEqual(methods[index].isPublic) diff --git a/packages/web3/src/codec/txscript-codec.ts b/packages/web3/src/codec/txscript-codec.ts index 21cff1475..4e77f58e8 100644 --- a/packages/web3/src/codec/txscript-codec.ts +++ b/packages/web3/src/codec/txscript-codec.ts @@ -21,6 +21,7 @@ import { Parser } from 'binary-parser' import { DecodedArray } from './array-codec' import { Codec } from './codec' import { DecodedMethod, Method, MethodCodec, methodsCodec } from './method-codec' +import { compactUnsignedIntCodec } from './compact-int-codec' export interface DecodedTxScript { methods: DecodedArray @@ -48,6 +49,12 @@ export class TxScriptCodec implements Codec { const methods = decodedTxScript.methods.value.map((decodedMethod) => MethodCodec.toMethod(decodedMethod)) return { methods } } + + encodeTxScript(inputTxScript: TxScript): Buffer { + const methodLength = compactUnsignedIntCodec.fromU32(inputTxScript.methods.length) + const decodedMethods = inputTxScript.methods.map((method) => MethodCodec.fromMethod(method)) + return this.encode({ methods: { value: decodedMethods, length: methodLength } }) + } } export const txScriptCodec = new TxScriptCodec() From 88971b99e0be7c9a9f3b37be4ffdaae4047945c2 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 24 May 2024 15:16:53 +0200 Subject: [PATCH 5/5] Use script-codec --- packages/web3/src/codec/script-codec.test.ts | 93 +++++++++++++- packages/web3/src/codec/script-codec.ts | 28 ++++- .../web3/src/codec/txscript-codec.test.ts | 113 ------------------ packages/web3/src/codec/txscript-codec.ts | 60 ---------- .../web3/src/codec/unlock-script-codec.ts | 4 +- packages/web3/src/codec/unsigned-tx-codec.ts | 4 +- 6 files changed, 118 insertions(+), 184 deletions(-) delete mode 100644 packages/web3/src/codec/txscript-codec.test.ts delete mode 100644 packages/web3/src/codec/txscript-codec.ts diff --git a/packages/web3/src/codec/script-codec.test.ts b/packages/web3/src/codec/script-codec.test.ts index ea4e58598..8a3a4d213 100644 --- a/packages/web3/src/codec/script-codec.test.ts +++ b/packages/web3/src/codec/script-codec.test.ts @@ -16,10 +16,24 @@ You should have received a copy of the GNU Lesser General Public License along with the library. If not, see . */ +import { + AddressConst, + AssertWithErrorCode, + ByteConst, + CallExternal, + LoadLocal, + U256Const0, + U256Const1, + U256Eq, + StoreLocal +} from './instr-codec' import { Buffer } from 'buffer/' -import { web3, Fields, FieldsSig, buildScriptByteCode } from '@alephium/web3' -import { randomContractId } from '@alephium/web3-test' +import { Script, bs58, web3, Fields, FieldsSig, buildScriptByteCode } from '@alephium/web3' +import { randomContractId, testAddress } from '@alephium/web3-test' import { scriptCodec } from './script-codec' +import { Method } from './method-codec' +import { LockupScript } from './lockup-script-codec' +import { DestroyAdd, GreeterMain } from '../../../../artifacts/ts' describe('Encode & decode scripts', function () { beforeAll(() => { @@ -144,6 +158,64 @@ describe('Encode & decode scripts', function () { ) }) + it('should encode & decode TxScript from the project', () => { + const contractId = randomContractId() + const decodedTestAddress = Buffer.from(bs58.decode(testAddress)) + const lockupScript = { + scriptType: decodedTestAddress[0], + script: { + publicKeyHash: decodedTestAddress.slice(1) + } + } as LockupScript + const contractIdByteString = { + length: { mode: 64, rest: Buffer.from(['32']) }, + value: Buffer.from(contractId, 'hex') + } + + testScript(DestroyAdd.script, { add: contractId, caller: testAddress }, [ + { + isPublic: true, + assetModifier: 3, + argsLength: 0, + localsLength: 0, + returnLength: 0, + instrs: [AddressConst(lockupScript), U256Const1, U256Const0, ByteConst(contractIdByteString), CallExternal(3)] + } + ]) + + testScript(GreeterMain.script, { greeterContractId: contractId }, [ + { + isPublic: true, + assetModifier: 3, + argsLength: 0, + localsLength: 2, + returnLength: 0, + instrs: [ + ByteConst(contractIdByteString), + StoreLocal(0), + U256Const0, + U256Const1, + LoadLocal(0), + CallExternal(0), + U256Const1, + U256Eq, + U256Const0, + AssertWithErrorCode, + ByteConst(contractIdByteString), + StoreLocal(1), + U256Const0, + U256Const1, + LoadLocal(1), + CallExternal(0), + U256Const1, + U256Eq, + U256Const0, + AssertWithErrorCode + ] + } + ]) + }) + async function testScriptCode( scriptCode: string, fields: Fields = {}, @@ -156,4 +228,21 @@ describe('Encode & decode scripts', function () { const encoded = scriptCodec.encode(decoded) expect(scriptBytecode).toEqual(encoded.toString('hex')) } + + function testScript(script: Script, fields: Fields, methods: Method[]) { + const txScriptBytecode = script.buildByteCodeToDeploy(fields) + const decodedTxScript = scriptCodec.decodeScript(Buffer.from(txScriptBytecode, 'hex')) + + expect(scriptCodec.encodeScript(decodedTxScript).toString('hex')).toEqual(txScriptBytecode) + + expect(decodedTxScript.methods.length).toEqual(methods.length) + decodedTxScript.methods.map((decodedMethod, index) => { + expect(decodedMethod.isPublic).toEqual(methods[index].isPublic) + expect(decodedMethod.assetModifier).toEqual(methods[index].assetModifier) + expect(decodedMethod.argsLength).toEqual(methods[index].argsLength) + expect(decodedMethod.localsLength).toEqual(methods[index].localsLength) + expect(decodedMethod.returnLength).toEqual(methods[index].returnLength) + expect(decodedMethod.instrs).toEqual(methods[index].instrs) + }) + } }) diff --git a/packages/web3/src/codec/script-codec.ts b/packages/web3/src/codec/script-codec.ts index 47e3d693c..4b7f10372 100644 --- a/packages/web3/src/codec/script-codec.ts +++ b/packages/web3/src/codec/script-codec.ts @@ -15,30 +15,48 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the library. If not, see . */ + import { Buffer } from 'buffer/' import { Parser } from 'binary-parser' import { DecodedArray } from './array-codec' import { Codec } from './codec' -import { DecodedMethod, methodsCodec } from './method-codec' +import { DecodedMethod, methodsCodec, Method, MethodCodec } from './method-codec' import { OptionCodec } from './option-codec' +import { compactUnsignedIntCodec } from './compact-int-codec' -export interface Script { +export interface DecodedScript { methods: DecodedArray } -export class ScriptCodec implements Codec