Skip to content

Commit

Permalink
backward compatible calls
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshihitoAso committed Dec 20, 2021
1 parent 03c1e8c commit f8d448b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contracts/token/IbetShare.sol
Original file line number Diff line number Diff line change
Expand Up @@ -763,4 +763,16 @@ contract IbetShare is Ownable, IbetSecurityTokenInterface {
// イベント登録
emit ChangeToCanceled();
}


/// ---------------------------------------------------------------
/// 後方互換対応
/// - 旧トークンフォーマットでのCallを一時的にサポート
/// - 次回バージョン以降で削除予定
/// ---------------------------------------------------------------

bool public offeringStatus;

mapping(uint8 => string) public referenceUrls;

}
17 changes: 17 additions & 0 deletions contracts/token/IbetStraightBond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -769,4 +769,21 @@ contract IbetStraightBond is Ownable, IbetSecurityTokenInterface {
emit ChangeToRedeemed();
}


/// ---------------------------------------------------------------
/// 後方互換対応
/// - 旧トークンフォーマットでのCallを一時的にサポート
/// - 次回バージョン以降で削除予定
/// ---------------------------------------------------------------

bool public initialOfferingStatus;

function getImageURL(uint8 _class)
public
view
returns (string memory)
{
return "";
}

}
4 changes: 4 additions & 0 deletions tests/token/test_IbetShare.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def test_normal_1(self, IbetShare, users):
assert status == True
assert balance == total_supply

# backward compatible calls
assert share_contract.offeringStatus() == False
assert share_contract.referenceUrls(0) == ""


# TEST_setPrincipalValue
class TestSetPrincipalValue:
Expand Down
4 changes: 4 additions & 0 deletions tests/token/test_IbetStraightBond.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def test_normal_1(self, users, IbetStraightBond):
assert is_redeemed == False
assert status == True

# backward compatible calls
assert bond_contract.initialOfferingStatus() == False
assert bond_contract.getImageURL(0) == ""


# TEST_transfer
class TestTransfer:
Expand Down

0 comments on commit f8d448b

Please sign in to comment.