Skip to content

Commit

Permalink
Hotfix LIT/DOT Holder VC (#2795)
Browse files Browse the repository at this point in the history
* use no-metadata

* add debug

* fix return value

* use no-metadata for total tx

* bump versions

* fix versions in ts
  • Loading branch information
Kailai-Wang authored Jun 11, 2024
1 parent 5a5ddc9 commit 1362036
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion runtime/litentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("litentry-parachain"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9180,
spec_version: 9181,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion runtime/litmus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("litmus-parachain"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9180,
spec_version: 9181,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("rococo-parachain"),
authoring_version: 1,
// same versioning-mechanism as polkadot: use last digit for minor updates
spec_version: 9180,
spec_version: 9181,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion tee-worker/app-libs/sgx-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node-template"),
impl_name: create_runtime_str!("node-template"),
authoring_version: 1,
spec_version: 106,
spec_version: 107,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn request_achainable(
)
})?;

Ok(false)
Ok(result)
}

pub fn request_uniswap_v2_or_v3_user(
Expand Down
20 changes: 15 additions & 5 deletions tee-worker/litentry/core/data-providers/src/achainable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl AchainableClient {
}

pub fn query_system_label(&mut self, address: &str, params: Params) -> Result<bool, Error> {
let body = ReqBody::new(address.into(), params);
// TODO: double-check it with Zhouhui if we don't ever need metadata here
let body = ReqBody::new_with_false_metadata(address.into(), params);
self.post(SystemLabelReqPath::default(), &body)
.and_then(AchainableClient::parse)
}
Expand Down Expand Up @@ -96,8 +97,13 @@ impl AchainablePost for AchainableClient {
let response = self
.client
.post_capture::<SystemLabelReqPath, ReqBody, serde_json::Value>(params, body);
debug!("ReqBody response: {:?}", response);
response.map_err(|e| Error::AchainableError(format!("Achainable response error: {}", e)))
match response {
Ok(r) => {
debug!("ReqBody response: {}", r);
Ok(r)
},
Err(e) => Err(Error::AchainableError(format!("Achainable response error: {}", e))),
}
}
}

Expand Down Expand Up @@ -690,7 +696,8 @@ fn check_achainable_label(
address: &str,
params: Params,
) -> Result<bool, Error> {
let body = ReqBody::new(address.into(), params);
// TODO: double-check it with Zhouhui if we don't ever need metadata here
let body = ReqBody::new_with_false_metadata(address.into(), params);
client
.post(SystemLabelReqPath::default(), &body)
.and_then(AchainableClient::parse)
Expand Down Expand Up @@ -796,7 +803,10 @@ impl AchainableAccountTotalTransactions for AchainableClient {
let amount = "1".to_string();

let param = ParamsBasicTypeWithAmount::new(name, network, amount);
let body = ReqBody::new(address.into(), Params::ParamsBasicTypeWithAmount(param));
let body = ReqBody::new_with_false_metadata(
address.into(),
Params::ParamsBasicTypeWithAmount(param),
);
let tx =
self.post(SystemLabelReqPath::default(), &body).and_then(Self::parse_txs)?;
txs += tx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export async function assertVc(context: IntegrationTestContext, subject: CorePri
// check runtime version is present
assert.deepEqual(
vcPayloadJson.issuer.runtimeVersion,
{ parachain: 9180, sidechain: 106 },
{ parachain: 9181, sidechain: 107 },
'Check VC runtime version: it should equal the current defined versions'
);

Expand Down

0 comments on commit 1362036

Please sign in to comment.