File tree Expand file tree Collapse file tree 4 files changed +32
-0
lines changed
contract/AElf.Contracts.MultiToken
test/AElf.Contracts.MultiToken.Tests Expand file tree Collapse file tree 4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -691,6 +691,16 @@ public override Int32Value GetMaxBatchApproveCount(Empty input)
691691 } ;
692692 }
693693
694+ public override Empty ExtendSeedExpirationTime ( ExtendSeedExpirationTimeInput input )
695+ {
696+ var tokenInfo = GetTokenInfo ( input . Symbol ) ;
697+ Assert ( tokenInfo != null , "Seed NFT does not exist." ) ;
698+ Assert ( tokenInfo . Owner == Context . Sender , "Sender is not Seed NFT owner." ) ;
699+
700+ tokenInfo . ExternalInfo . Value [ "__seed_exp_time" ] = input . ExpirationTime ;
701+ return base . ExtendSeedExpirationTime ( input ) ;
702+ }
703+
694704 private int GetMaxBatchApproveCount ( )
695705 {
696706 return State . MaxBatchApproveCount . Value == 0
Original file line number Diff line number Diff line change @@ -182,6 +182,9 @@ service TokenContractImpl {
182182 rpc GetMaxBatchApproveCount (google .protobuf .Empty ) returns (google .protobuf .Int32Value ) {
183183
184184 }
185+
186+ rpc ExtendSeedExpirationTime (ExtendSeedExpirationTimeInput ) returns (google .protobuf .Empty ) {
187+ }
185188}
186189
187190message AdvanceResourceTokenInput {
@@ -444,4 +447,9 @@ message ModifyTokenIssuerAndOwnerInput {
444447
445448message SetTokenIssuerAndOwnerModificationEnabledInput {
446449 bool enabled = 1 ;
450+ }
451+
452+ message ExtendSeedExpirationTimeInput {
453+ string symbol = 1 ;
454+ int64 expiration_time = 2 ;
447455}
Original file line number Diff line number Diff line change @@ -1893,4 +1893,15 @@ public async Task TokenIssuerAndOwnerModification_Test()
18931893 result . TransactionResult . Error . ShouldContain ( "Set token issuer and owner disabled." ) ;
18941894
18951895 }
1896+
1897+ [ Theory ]
1898+ [ InlineData ( "SEED-0" , 1731927992000 ) ]
1899+ public async Task ExtendSeedExpirationTime_Test ( string symbol , long expirationTime )
1900+ {
1901+ ExtendSeedExpirationTimeInput input = new ExtendSeedExpirationTimeInput ( ) ;
1902+ input . Symbol = symbol ;
1903+ input . ExpirationTime = expirationTime ;
1904+
1905+ await TokenContractStub . ExtendSeedExpirationTime . CallAsync ( input ) ;
1906+ }
18961907}
Original file line number Diff line number Diff line change @@ -240,4 +240,7 @@ internal async Task<IExecutionResult<Empty>> CreateMutiTokenWithExceptionAsync(
240240 await CreateSeedNftAsync ( stub , createInput ) ;
241241 return await stub . Create . SendWithExceptionAsync ( createInput ) ;
242242 }
243+
244+
245+
243246}
You can’t perform that action at this time.
0 commit comments