Skip to content

Commit 725084b

Browse files
Copilotbegonaalvarezdmarc2332Thoralf-M
authored
Enable mainnet test for e2eLiveNetworkDryRunFlow (#1084)
* Initial plan * Enable mainnet test in live.test.ts Co-authored-by: begonaalvarezd <3624944+begonaalvarezd@users.noreply.github.com> * fix mainnet cost and adjust to allowed name * update to shrimp address --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: begonaalvarezd <3624944+begonaalvarezd@users.noreply.github.com> Co-authored-by: Marc Espin <mespinsanz@gmail.com> Co-authored-by: Thoralf Müller <thoralf.mue@gmail.com>
1 parent 8ec996f commit 725084b

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

sdk/test/live.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ import { describe, expect, it } from 'vitest';
88
import { e2eLiveNetworkDryRunFlow } from './pre-built';
99

1010
describe('it should work on live networks', () => {
11-
// TODO: enable when it's deployed on mainnet
12-
// it('should work on mainnet', async () => {
13-
// const res = await e2eLiveNetworkDryRunFlow('mainnet');
14-
// expect(res.effects.status.status).toEqual('success');
15-
// });
11+
it('should work on mainnet', async () => {
12+
const res = await e2eLiveNetworkDryRunFlow(Network.Mainnet);
13+
expect(res.effects.status.status).toEqual('success');
14+
});
1615
it('should work on testnet', async () => {
1716
const res = await e2eLiveNetworkDryRunFlow(Network.Testnet);
1817
expect(res.effects.status.status).toEqual('success');

sdk/test/pre-built.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
2020
let sender;
2121
if (network.id === Network.Mainnet) {
2222
sender = normalizeIotaAddress(
23-
'0x96e5664b870afebcef5534732a067b877cfd3a70e83384b3e61e9ab92a4d3bab',
23+
'0xbb9ae3e92fd3020d8cfe76cc954da4dbd2b20f39c7077e4b4109410e8f126057',
2424
);
2525
} else {
2626
sender = normalizeIotaAddress('0x2');
@@ -88,7 +88,9 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
8888
(Date.now().toString(36) + Math.random().toString(36).substring(2)).repeat(2) + '.iota';
8989

9090
let gas;
91-
if (network.id === Network.Testnet) {
91+
if (network.id === Network.Mainnet) {
92+
gas = 500n;
93+
} else if (network.id === Network.Testnet) {
9294
gas = 250n;
9395
} else {
9496
gas = 6n;
@@ -126,7 +128,7 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
126128

127129
const subNft = iotaNamesTx.createSubname({
128130
parentNft: nft,
129-
name: 'node.' + uniqueName,
131+
name: 'node-subname.' + uniqueName,
130132
expirationTimestampMs: Date.now() + 1000 * 60 * 60 * 24 * 30,
131133
allowChildCreation: true,
132134
allowTimeExtension: true,
@@ -143,10 +145,10 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
143145
// do it for sub nft too
144146
iotaNamesTx.createLeafSubname({
145147
parentNft: subNft,
146-
name: 'leaf.node.' + uniqueName,
148+
name: 'leaf.node-subname.' + uniqueName,
147149
targetAddress: sender,
148150
});
149-
iotaNamesTx.removeLeafSubname({ parentNft: subNft, name: 'leaf.node.' + uniqueName });
151+
iotaNamesTx.removeLeafSubname({ parentNft: subNft, name: 'leaf.node-subname.' + uniqueName });
150152

151153
// extend expiration a bit further for the subNft
152154
iotaNamesTx.extendExpiration({
@@ -156,23 +158,23 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
156158

157159
iotaNamesTx.editSetup({
158160
parentNft: nft,
159-
name: 'node.' + uniqueName,
161+
name: 'node-subname.' + uniqueName,
160162
allowChildCreation: true,
161163
allowTimeExtension: false,
162164
});
163165

164166
// let's go 2 levels deep and edit setups!
165167
const moreNestedNft = iotaNamesTx.createSubname({
166168
parentNft: subNft,
167-
name: 'more.node.' + uniqueName,
169+
name: 'more.node-subname.' + uniqueName,
168170
allowChildCreation: true,
169171
allowTimeExtension: true,
170172
expirationTimestampMs: Date.now() + 1000 * 60 * 60 * 24 * 30,
171173
});
172174

173175
iotaNamesTx.editSetup({
174176
parentNft: subNft,
175-
name: 'more.node.' + uniqueName,
177+
name: 'more.node-subname.' + uniqueName,
176178
allowChildCreation: false,
177179
allowTimeExtension: false,
178180
});
@@ -185,9 +187,14 @@ export const e2eLiveNetworkDryRunFlow = async (network_id: Network) => {
185187
if (network.id === Network.Mainnet) {
186188
tx.setGasPayment([
187189
{
188-
objectId: '0xec38c03899fd44ed837038f1e3659b38e0cc24fd760db72130486280ee933fe1',
190+
objectId: '0xc807394d03a93089862c9d9fd53235ddef034539284e821f093a968fe8868ff7',
191+
version: '1',
192+
digest: 'BoPYYfhsmbW3h45FENf6QLfZoQ87vohZFVTqr9yojGpa',
193+
},
194+
{
195+
objectId: '0x13ef83511595ac52c68b3575ee104b1a17d1bb990b8fa1495930721b18a3aa3c',
189196
version: '1',
190-
digest: 'CkJeMaSxggPLp5g9xGA57zf1FeHcuQLVQHJ6Tm7ZME5o',
197+
digest: '6R7Z1SZMixCZtZpxjLoML1k3utWQs6uJ1bEFve1rqsfK',
191198
},
192199
]);
193200
} else if (network.id === Network.Testnet) {

0 commit comments

Comments
 (0)