diff --git a/Cargo.toml b/Cargo.toml index 25a23708..e133f299 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "babylon-ledger-app" -version = "0.5.3" +version = "0.5.4" authors = ["siy"] edition = "2021" description = "Radix Babylon" diff --git a/sbor/src/print/instruction_printer.rs b/sbor/src/print/instruction_printer.rs index 57104ee0..142c9645 100644 --- a/sbor/src/print/instruction_printer.rs +++ b/sbor/src/print/instruction_printer.rs @@ -566,9 +566,9 @@ mod tests { check_partial_decoding( &TX_ACCESS_RULE, br##" -1 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "set_owner" Tuple(Enum<0u8>(), ) -2 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "lock_owner" Tuple() -3 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "set" Tuple(Enum<0u8>(), "hello", Enum<0u8>(), ) +1 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "set_owner_role" Tuple(Enum<0u8>(), ) +2 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "lock_owner_role" Tuple() +3 of 3: CallRoleAssignmentMethod Enum<0u8>(Address(resource_loc1thvwu8dh6lk4y9mntemkvj25wllq8adq42skzufp4m8wxxue22t7al), ) "set_role" Tuple(Enum<0u8>(), "hello", Enum<0u8>(), ) "##, &DetectedTxType::Other(None), ); @@ -604,7 +604,7 @@ br##" 1 of 4: CallMethod Enum<0u8>(Address(component_loc1cqvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve2jtvlp), ) "complicated_method" Tuple(Decimal(1), PreciseDecimal(2), ) 2 of 4: CallRoyaltyMethod Enum<0u8>(Address(component_loc1cqvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve2jtvlp), ) "set_royalty" Tuple("my_method", Enum<0u8>(), ) 3 of 4: CallMetadataMethod Enum<0u8>(Address(component_loc1cqvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve2jtvlp), ) "get" Tuple("HelloWorld", ) -4 of 4: CallRoleAssignmentMethod Enum<0u8>(Address(component_loc1cqvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve2jtvlp), ) "get" Tuple(Enum<0u8>(), "hello", ) +4 of 4: CallRoleAssignmentMethod Enum<0u8>(Address(component_loc1cqvgx33089ukm2pl97pv4max0x40ruvfy4lt60yvya744cve2jtvlp), ) "get_role" Tuple(Enum<0u8>(), "hello", ) "##, &DetectedTxType::Other(None), ); diff --git a/sbor/src/tx_intent_test_data.rs b/sbor/src/tx_intent_test_data.rs index 44d59b90..0b86150c 100644 --- a/sbor/src/tx_intent_test_data.rs +++ b/sbor/src/tx_intent_test_data.rs @@ -1,11 +1,11 @@ #[cfg(test)] pub mod tests { pub const TX_ACCESS_RULE_HASH: [u8; 32] = [ - 0x00, 0x18, 0x52, 0x16, 0x4e, 0x1c, 0xfc, 0x3b, 0x03, 0xb0, 0x90, 0x21, 0xeb, 0xf2, 0x09, - 0xf4, 0xd3, 0xf2, 0x62, 0xe1, 0xa2, 0x99, 0x88, 0xa4, 0x11, 0x4a, 0xc5, 0x84, 0x35, 0x3e, - 0xf7, 0x44, + 0xf9, 0xb2, 0x36, 0xcd, 0xa2, 0x61, 0x6a, 0x4a, 0x95, 0xa7, 0x59, 0xda, 0xed, 0x6e, 0x2b, + 0xbe, 0x50, 0x7b, 0x0d, 0xda, 0xf4, 0x4b, 0x7d, 0x4c, 0x49, 0x76, 0xf6, 0x3f, 0x4d, 0x52, + 0x92, 0xb7, ]; - pub const TX_ACCESS_RULE: [u8; 244] = [ + pub const TX_ACCESS_RULE: [u8; 259] = [ 0x4d, 0x22, 0x01, 0x04, 0x21, 0x07, 0x07, 0xf2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x05, 0x00, 0x00, 0x00, 0x22, 0x01, 0x01, 0x20, 0x07, 0x20, 0xf3, 0x81, 0x62, 0x6e, 0x41, 0xe7, 0x02, 0x7e, @@ -13,14 +13,15 @@ pub mod tests { 0x94, 0x8d, 0x6c, 0x3c, 0x7c, 0x5d, 0xc9, 0xa5, 0x4b, 0x01, 0x00, 0x08, 0x03, 0x00, 0x20, 0x22, 0x03, 0x44, 0x03, 0x22, 0x00, 0x01, 0x80, 0x00, 0x5d, 0xd8, 0xee, 0x1d, 0xb7, 0xd7, 0xed, 0x52, 0x17, 0x73, 0x5e, 0x77, 0x66, 0x49, 0x54, 0x77, 0xfe, 0x03, 0xf5, 0xa0, 0xaa, - 0xa1, 0x61, 0x71, 0x21, 0xae, 0xce, 0xe3, 0x1b, 0x99, 0x0c, 0x09, 0x73, 0x65, 0x74, 0x5f, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x21, 0x01, 0x22, 0x00, 0x00, 0x44, 0x03, 0x22, 0x00, 0x01, - 0x80, 0x00, 0x5d, 0xd8, 0xee, 0x1d, 0xb7, 0xd7, 0xed, 0x52, 0x17, 0x73, 0x5e, 0x77, 0x66, - 0x49, 0x54, 0x77, 0xfe, 0x03, 0xf5, 0xa0, 0xaa, 0xa1, 0x61, 0x71, 0x21, 0xae, 0xce, 0xe3, - 0x1b, 0x99, 0x0c, 0x0a, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x21, - 0x00, 0x44, 0x03, 0x22, 0x00, 0x01, 0x80, 0x00, 0x5d, 0xd8, 0xee, 0x1d, 0xb7, 0xd7, 0xed, - 0x52, 0x17, 0x73, 0x5e, 0x77, 0x66, 0x49, 0x54, 0x77, 0xfe, 0x03, 0xf5, 0xa0, 0xaa, 0xa1, - 0x61, 0x71, 0x21, 0xae, 0xce, 0xe3, 0x1b, 0x99, 0x0c, 0x03, 0x73, 0x65, 0x74, 0x21, 0x03, + 0xa1, 0x61, 0x71, 0x21, 0xae, 0xce, 0xe3, 0x1b, 0x99, 0x0c, 0x0e, 0x73, 0x65, 0x74, 0x5f, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x21, 0x01, 0x22, 0x00, 0x00, + 0x44, 0x03, 0x22, 0x00, 0x01, 0x80, 0x00, 0x5d, 0xd8, 0xee, 0x1d, 0xb7, 0xd7, 0xed, 0x52, + 0x17, 0x73, 0x5e, 0x77, 0x66, 0x49, 0x54, 0x77, 0xfe, 0x03, 0xf5, 0xa0, 0xaa, 0xa1, 0x61, + 0x71, 0x21, 0xae, 0xce, 0xe3, 0x1b, 0x99, 0x0c, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x21, 0x00, 0x44, 0x03, 0x22, 0x00, + 0x01, 0x80, 0x00, 0x5d, 0xd8, 0xee, 0x1d, 0xb7, 0xd7, 0xed, 0x52, 0x17, 0x73, 0x5e, 0x77, + 0x66, 0x49, 0x54, 0x77, 0xfe, 0x03, 0xf5, 0xa0, 0xaa, 0xa1, 0x61, 0x71, 0x21, 0xae, 0xce, + 0xe3, 0x1b, 0x99, 0x0c, 0x08, 0x73, 0x65, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x21, 0x03, 0x22, 0x00, 0x00, 0x0c, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x22, 0x00, 0x00, 0x20, 0x20, 0x00, 0x22, 0x00, 0x00, ]; @@ -91,11 +92,11 @@ pub mod tests { 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x00, 0x22, 0x00, 0x00, ]; pub const TX_CALL_METHOD_HASH: [u8; 32] = [ - 0xa3, 0xea, 0x60, 0xda, 0xbd, 0x81, 0x0d, 0x91, 0xb7, 0x5c, 0xb9, 0xb9, 0xb0, 0x2e, 0xfd, - 0x08, 0xeb, 0x5e, 0x89, 0xee, 0x10, 0xcf, 0xad, 0x38, 0x96, 0x1e, 0x69, 0x76, 0x7d, 0x37, - 0x44, 0xa9, + 0x45, 0x59, 0xbc, 0x0b, 0xd7, 0x6a, 0x63, 0x39, 0x3b, 0x19, 0xf1, 0xc7, 0xd1, 0xd2, 0x9e, + 0x27, 0x5d, 0x9a, 0x2d, 0x3e, 0xe5, 0xaa, 0x5c, 0x0b, 0xeb, 0x4d, 0x2e, 0xc0, 0x60, 0xf6, + 0xa2, 0x3a, ]; - pub const TX_CALL_METHOD: [u8; 416] = [ + pub const TX_CALL_METHOD: [u8; 421] = [ 0x4d, 0x22, 0x01, 0x04, 0x21, 0x07, 0x07, 0xf2, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0xe8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x05, 0x00, 0x00, 0x00, 0x22, 0x01, 0x01, 0x20, 0x07, 0x20, 0xf3, 0x81, 0x62, 0x6e, 0x41, 0xe7, 0x02, 0x7e, @@ -122,8 +123,9 @@ pub mod tests { 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x44, 0x03, 0x22, 0x00, 0x01, 0x80, 0x00, 0xc0, 0x18, 0x83, 0x46, 0x2f, 0x39, 0x79, 0x6d, 0xa8, 0x3f, 0x2f, 0x82, 0xca, 0xef, 0xa6, 0x79, 0xaa, 0xf1, 0xf1, 0x89, 0x25, 0x7e, 0xbd, 0x3c, 0x8c, 0x27, 0x7d, - 0x5a, 0xe1, 0x99, 0x0c, 0x03, 0x67, 0x65, 0x74, 0x21, 0x02, 0x22, 0x00, 0x00, 0x0c, 0x05, - 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x20, 0x00, 0x22, 0x00, 0x00, + 0x5a, 0xe1, 0x99, 0x0c, 0x08, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x21, 0x02, + 0x22, 0x00, 0x00, 0x0c, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x20, 0x00, 0x22, 0x00, + 0x00, ]; pub const TX_CREATE_ACCESS_CONTROLLER_HASH: [u8; 32] = [ 0x90, 0xba, 0xc0, 0x2f, 0x91, 0xa8, 0xdf, 0x81, 0x52, 0x4c, 0xac, 0x32, 0x1a, 0x1d, 0xe3, diff --git a/test/data/access_rule.txn b/test/data/access_rule.txn index 5209b708..bb05b52c 100644 Binary files a/test/data/access_rule.txn and b/test/data/access_rule.txn differ diff --git a/test/data/call_method.txn b/test/data/call_method.txn index 0c864727..01c21b1e 100644 Binary files a/test/data/call_method.txn and b/test/data/call_method.txn differ diff --git a/test/test-get-application-version.py b/test/test-get-application-version.py index 8417c252..f75b7b71 100755 --- a/test/test-get-application-version.py +++ b/test/test-get-application-version.py @@ -23,5 +23,5 @@ print("Testing", "GetAppVersion", instructionCode, end=" ") response = dongle.exchange(bytes.fromhex(instructionClass + instructionCode + p1 + p2 + dataLength)) -assert response.hex() == '000503', "Invalid version\nReceived:" + response.hex() +assert response.hex() == '000504', "Invalid version\nReceived:" + response.hex() print("Success")