Skip to content

Commit 329763f

Browse files
committed
update chainID
1 parent 0bd2de2 commit 329763f

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

stacks/contracts/executor.clar

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111

1212
;; constants
1313
(define-constant EXECUTOR-VERSION "Executor-0.0.1")
14-
(define-constant OUR-CHAIN u1) ;; Must be manually updated before deployment. Worth doing it this way or an initialize call?
14+
(define-constant OUR-CHAIN u60) ;; Must be manually updated before deployment. Worth doing it this way or an initialize call?
1515

1616
;; addr32 contract reference - update before deployment
1717
;; Local/Test: .addr32
1818
;; Testnet: 'ST2W4SFFKXMGFJW7K7NZFK3AH52ZTXDB74HKV9MRA.addr32
19-
;; Mainnet: TBD
20-
19+
2120
;; errors
2221
(define-constant ERR-QUOTE-SRC-CHAIN-MISMATCH (err u1001))
2322
(define-constant ERR-QUOTE-DST-CHAIN-MISMATCH (err u1002))

stacks/tests/executor.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("Executor Contract Tests", () => {
6060
it("should validate a correct quote header", () => {
6161
// Create a valid quote buffer
6262
const validQuote = createSignedQuoteBuffer({
63-
srcChain: 1, // OUR-CHAIN = 1
63+
srcChain: 60, // OUR-CHAIN = 60 (Stacks testnet)
6464
dstChain: 2, // Destination chain
6565
expiryTime: 9999999999 // Future timestamp placeholder // 1 hour in the future
6666
});
@@ -77,7 +77,7 @@ describe("Executor Contract Tests", () => {
7777

7878
it("should reject quote with wrong source chain", () => {
7979
const invalidQuote = createSignedQuoteBuffer({
80-
srcChain: 99, // Wrong source chain (OUR-CHAIN = 1)
80+
srcChain: 99, // Wrong source chain (OUR-CHAIN = 60)
8181
dstChain: 2,
8282
expiryTime: 9999999999 // Future timestamp placeholder
8383
});
@@ -94,7 +94,7 @@ describe("Executor Contract Tests", () => {
9494

9595
it("should reject quote with wrong destination chain", () => {
9696
const invalidQuote = createSignedQuoteBuffer({
97-
srcChain: 1, // Correct source chain
97+
srcChain: 60, // Correct source chain
9898
dstChain: 99, // Wrong destination chain
9999
expiryTime: 9999999999 // Future timestamp placeholder
100100
});
@@ -111,7 +111,7 @@ describe("Executor Contract Tests", () => {
111111

112112
it("should reject expired quote", () => {
113113
const expiredQuote = createSignedQuoteBuffer({
114-
srcChain: 1,
114+
srcChain: 60,
115115
dstChain: 2,
116116
expiryTime: 1000000000 // Past timestamp placeholder // 1 hour ago (expired)
117117
});
@@ -606,13 +606,13 @@ describe("Executor Contract Tests", () => {
606606
describe("get-our-chain", () => {
607607
it("should return correct chain ID", () => {
608608
const { result } = simnet.callReadOnlyFn(
609-
"executor",
609+
"executor",
610610
"get-our-chain",
611611
[],
612612
address1
613613
);
614-
615-
expect(result).toBeUint(1);
614+
615+
expect(result).toBeUint(60); // Stacks testnet chain ID
616616
});
617617
});
618618

@@ -644,7 +644,7 @@ describe("Executor Contract Tests", () => {
644644

645645
// Create quote with the registered relayer's universal address as payee
646646
const validQuote = createSignedQuoteBuffer({
647-
srcChain: 1, // OUR-CHAIN
647+
srcChain: 60, // OUR-CHAIN (Stacks testnet)
648648
dstChain: 2, // Target chain
649649
expiryTime: 9999999999, // Future timestamp placeholder
650650
payeeAddr: payeeBytes
@@ -702,7 +702,7 @@ describe("Executor Contract Tests", () => {
702702
const universalAddr = registerTestPayee(relayerAddr);
703703

704704
const invalidQuote = createSignedQuoteBuffer({
705-
srcChain: 1,
705+
srcChain: 60,
706706
dstChain: 99, // Wrong destination chain
707707
expiryTime: 9999999999, // Future timestamp placeholder
708708
payeeAddr: universalAddr
@@ -731,7 +731,7 @@ describe("Executor Contract Tests", () => {
731731
const universalAddr = registerTestPayee(relayerAddr);
732732

733733
const expiredQuote = createSignedQuoteBuffer({
734-
srcChain: 1,
734+
srcChain: 60,
735735
dstChain: 2,
736736
expiryTime: 1000000000, // Past timestamp placeholder // 1 hour ago (expired)
737737
payeeAddr: universalAddr
@@ -761,7 +761,7 @@ describe("Executor Contract Tests", () => {
761761
unregisteredPayee.fill(0xFF); // Address that's not registered
762762

763763
const validQuote = createSignedQuoteBuffer({
764-
srcChain: 1,
764+
srcChain: 60,
765765
dstChain: 2,
766766
expiryTime: 9999999999, // Future timestamp placeholder
767767
payeeAddr: unregisteredPayee
@@ -796,7 +796,7 @@ describe("Executor Contract Tests", () => {
796796
));
797797

798798
const validQuote = createSignedQuoteBuffer({
799-
srcChain: 1,
799+
srcChain: 60,
800800
dstChain: 3,
801801
expiryTime: 9999999999, // Future timestamp placeholder
802802
payeeAddr: payeeBytes
@@ -873,7 +873,7 @@ describe("Executor Contract Tests", () => {
873873

874874
// Verify source chain (uint16 at offset 56: 4 + 20 + 32 bytes)
875875
const srcChainHex = signedQuoteHex.substr(112, 4); // 2 bytes = 4 hex chars
876-
expect(srcChainHex).toBe("0001"); // Source chain = 1
876+
expect(srcChainHex).toBe("003c"); // Source chain = 60 (0x3c)
877877

878878
// Verify destination chain (uint16 at offset 58: 4 + 20 + 32 + 2 bytes)
879879
const dstChainHex = signedQuoteHex.substr(116, 4); // 2 bytes = 4 hex chars

0 commit comments

Comments
 (0)