Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SIP-010 Names V2 #61

Merged
merged 1 commit into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/citycoin.clar
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@
)

;;;;;;;;;;;;;;;;;;;;; SIP 010 ;;;;;;;;;;;;;;;;;;;;;;
;; testnet: (impl-trait 'ST1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHEG3NHN3.sip-010-trait.sip-010-trait)
(impl-trait 'SP1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHD4Q0A5F.sip-010-trait.sip-010-trait)
;; testnet: (impl-trait 'STR8P3RD1EHA8AA37ERSSSZSWKS9T2GYQFGXNA4C.sip-010-trait-ft-standard.sip-010-trait)
(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)

(define-public (transfer (amount uint) (from principal) (to principal) (memo (optional (buff 34))))
(begin
Expand All @@ -900,7 +900,7 @@
(define-read-only (get-decimals)
(ok u0))

(define-read-only (get-balance-of (user principal))
(define-read-only (get-balance (user principal))
(ok (ft-get-balance citycoins user)))

(define-read-only (get-total-supply)
Expand Down
2 changes: 1 addition & 1 deletion contracts/sip-10-ft-standard.clar
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(get-decimals () (response uint uint))

;; the balance of the passed principal
(get-balance-of (principal) (response uint uint))
(get-balance (principal) (response uint uint))

;; the current total supply (which does not need to be a constant)
(get-total-supply () (response uint uint))
Expand Down
2 changes: 1 addition & 1 deletion scripts/clarinet-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ contracts_dir=$(readlink -e "$contracts_dir_rel")
contracts_clarinet_dir="${contracts_dir}/clarinet"
contracts_test_addons_dir="${contracts_dir}/test_addons"

sip10_address="SP1X6M947Z7E58CNE0H8YJVJTVKS9VW0PHD4Q0A5F.sip-010-trait.sip-010-trait"
sip10_address="SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait"
mock_sip10_address="ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.sip-010-trait.sip-010-trait"

rm -rf "${contracts_clarinet_dir}"
Expand Down
4 changes: 2 additions & 2 deletions src/citycoin-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ export class CityCoinClient {
return this.callReadOnlyFn("get-decimals");
}

getBalanceOf(user: Account): Result {
return this.callReadOnlyFn("get-balance-of", [
getBalance(user: Account): Result {
return this.callReadOnlyFn("get-balance", [
types.principal(user.address)
])
}
Expand Down
6 changes: 3 additions & 3 deletions tests/citycoin_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ describe('[CityCoin]', () => {
});
});

describe("get-balance-of()", () => {
describe("get-balance()", () => {
it("should return 0", () => {
const result = client.getBalanceOf(wallet_1).result;
const result = client.getBalance(wallet_1).result;

result.expectOk().expectUint(0);
});
Expand All @@ -112,7 +112,7 @@ describe('[CityCoin]', () => {
client.ftMint(100, wallet_1)
]);

const result = client.getBalanceOf(wallet_1).result;
const result = client.getBalance(wallet_1).result;

result.expectOk().expectUint(100);
});
Expand Down