Skip to content

Commit

Permalink
Merge pull request #173 from arda-org/macos-arm64
Browse files Browse the repository at this point in the history
MacOS ARM64
  • Loading branch information
lcswillems authored Jul 9, 2024
2 parents 495b870 + e8e64aa commit 8b0086b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 78 deletions.
10 changes: 9 additions & 1 deletion xsuite-fullsimulnet/build-binary.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import assert from "node:assert";
import { $, minimist } from "zx";

const argv = minimist(process.argv.slice(2));

await $`GOBIN="$(pwd)" GOOS=${argv.os} GOARCH=${argv.arch} go install -ldflags ${argv.ldflags} github.com/multiversx/mx-chain-simulator-go/cmd/chainsimulator@v1.7.12-rc1`;
if (process.env.CI) {
assert.deepStrictEqual(await $`go env GOOS GOARCH`.lines(), [
argv.os,
argv.arch,
]);
}

await $`GOBIN="$(pwd)" go install -ldflags ${argv.ldflags} github.com/multiversx/mx-chain-simulator-go/cmd/chainsimulator@v1.7.12-rc1`;
await $`mv ./chainsimulator ../xsuite-fullsimulnet-${argv.os}-${argv.arch}/bin/fsproxy`;
10 changes: 9 additions & 1 deletion xsuite-lightsimulnet/build-binary.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import assert from "node:assert";
import { $, cd, minimist } from "zx";

const argv = minimist(process.argv.slice(2));

if (process.env.CI) {
assert.deepStrictEqual(await $`go env GOOS GOARCH`.lines(), [
argv.os,
argv.arch,
]);
}

cd("src");
await $`GOOS=${argv.os} GOARCH=${argv.arch} go build -o ../../xsuite-lightsimulnet-${argv.os}-${argv.arch}/bin/lsproxy -ldflags ${argv.ldflags}`;
await $`go build -o ../../xsuite-lightsimulnet-${argv.os}-${argv.arch}/bin/lsproxy -ldflags ${argv.ldflags}`;
15 changes: 8 additions & 7 deletions xsuite-lightsimulnet/src/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module lsproxy

go 1.17
go 1.20

require (
github.com/go-chi/chi v1.5.4
github.com/multiversx/mx-chain-core-go v1.2.18
github.com/multiversx/mx-chain-logger-go v1.0.13
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240413152730-7374ba129c4f
github.com/multiversx/mx-chain-vm-common-go v1.5.11
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240428121053-a93ccf9aadf8
github.com/multiversx/mx-chain-core-go v1.2.20
github.com/multiversx/mx-chain-logger-go v1.0.14
github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240708183543-61f6e1880d1d
github.com/multiversx/mx-chain-vm-common-go v1.5.12
github.com/multiversx/mx-chain-vm-go v1.5.29
)

require (
Expand All @@ -24,7 +24,8 @@ require (
github.com/herumi/bls-go-binary v1.28.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.9 // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.11 // indirect
github.com/multiversx/mx-chain-storage-go v1.0.15 // indirect
github.com/multiversx/mx-components-big-int v1.0.0 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
golang.org/x/crypto v0.3.0 // indirect
Expand Down
82 changes: 16 additions & 66 deletions xsuite-lightsimulnet/src/go.sum

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion xsuite-lightsimulnet/src/handleTransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ func (e *Executor) HandleTransactionSendMultiple(r *http.Request) (interface{},
e.txCounter += 1
txHash := uint64ToString(e.txCounter)
txsHashes[strconv.Itoa(i)] = txHash
e.executeTx(txHash, rawTx)
err := e.executeTx(txHash, rawTx)
if err != nil {
return nil, err
}
}
jOutput := map[string]interface{}{
"data": map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion xsuite/src/data/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ const eKvsEsdt = ({ id, roles, lastNonce, ...rest }: EncodableEsdt): Kvs => {
}
if (metadata.length > 0) {
metadata.push(["Nonce", nonce.toString()]);
message["Properties"] = new Uint8Array([1]);
message["Metadata"] = Object.fromEntries(metadata);
message["Reserved"] = new Uint8Array([1]);
}
} else {
for (const [k, v] of Object.entries(rest)) {
Expand Down
7 changes: 6 additions & 1 deletion xsuite/src/data/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ test("e.kvs - complex kvs", () => {
id: sft1Id,
variants: range(1, 11).map((i) => ({
nonce: i,
amount: i,
name: `SFT1 ${i}`,
royalties: i,
hash: e.U(i),
Expand All @@ -729,13 +730,15 @@ test("e.kvs - complex kvs", () => {
id: sft2Id,
variants: range(1, 11).map((i) => ({
nonce: i,
amount: i,
attrs: e.Tuple(e.Str(`${i}`), e.U(i)),
creator: contract,
})),
},
{
id: sft3Id,
nonce: 1,
amount: 1,
creator: contract,
},
],
Expand Down Expand Up @@ -1307,6 +1310,7 @@ test("d.kvs", async () => {
id: sft1Id,
variants: range(1, 11).map((i) => ({
nonce: i,
amount: BigInt(i),
name: `SFT1 ${i}`,
royalties: i,
hash: e.U(i).toTopHex(),
Expand All @@ -1319,11 +1323,12 @@ test("d.kvs", async () => {
id: sft2Id,
variants: range(1, 11).map((i) => ({
nonce: i,
amount: BigInt(i),
attrs: [`${i}`, BigInt(i)],
creator: contract,
})),
},
{ id: sft3Id, variants: [{ nonce: 1, creator: contract }] },
{ id: sft3Id, variants: [{ nonce: 1, amount: 1n, creator: contract }] },
],
});
});
Expand Down

0 comments on commit 8b0086b

Please sign in to comment.