Skip to content

Commit

Permalink
Merge pull request #450 from identity-com/develop
Browse files Browse the repository at this point in the history
Solana Gateway: expireToken hotfix
  • Loading branch information
dankelleher authored Jun 27, 2023
2 parents 88f4803 + d94bfee commit 05d49c7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 62 deletions.
60 changes: 0 additions & 60 deletions solana/gateway-ts/scripts/burn.ts

This file was deleted.

2 changes: 1 addition & 1 deletion solana/program/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solana-gateway"
version = "0.3.0"
version = "0.3.1"
description = "OCIV Gateway Program"
authors = ["Daniel Kelleher <[email protected]>"]
repository = "https://github.com/identity-com/on-chain-identity-gateway"
Expand Down
4 changes: 3 additions & 1 deletion solana/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ fn expire_token(accounts: &[AccountInfo], gatekeeper_network: Pubkey) -> Program

gateway_token.set_expire_time(Clock::get()?.unix_timestamp - 120);

Ok(())
gateway_token
.serialize(&mut *gateway_token_info.data.borrow_mut())
.map_err(|e| e.into()) as ProgramResult
}

fn add_feature_to_network(accounts: &[AccountInfo], feature: NetworkFeature) -> ProgramResult {
Expand Down
7 changes: 7 additions & 0 deletions solana/program/tests/update_gateway_token_expiry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ async fn expire_token_should_succeed() {
.process_transaction(expire_tx)
.await
.unwrap();

let now = GatewayContext::now();
let gateway_token = context
.get_gateway_token(&context.owner.pubkey())
.await
.unwrap();
assert!(gateway_token.expire_time.unwrap() <= now);
}

#[tokio::test]
Expand Down

0 comments on commit 05d49c7

Please sign in to comment.